Skip to content

Commit 2715560

Browse files
author
John Siegel
committed
Fixed mistaken use of errout.string() instead of errout_string()
1 parent 8563eed commit 2715560

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: lib/checkexceptionsafety.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ void CheckExceptionSafety::rethrowNoCurrentException()
374374
{
375375
logChecker("CheckExceptionSafety::rethrowNoCurrentException");
376376
const SymbolDatabase* const symbolDatabase = mTokenizer->getSymbolDatabase();
377+
377378
for (const Scope * scope : symbolDatabase->functionScopes) {
378379
const Function* function = scope->function;
379380
if (!function)

Diff for: test/testexceptionsafety.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -455,22 +455,22 @@ class TestExceptionSafety : public TestFixture {
455455

456456
void exceptionDispatchIdiomInMiddleOfFunction() {
457457
check("void on_error() { int foo = 5; try { throw; } catch (...) { ; } }");
458-
ASSERT_EQUALS("", errout.str());
458+
ASSERT_EQUALS("", errout_str());
459459

460460
check("void on_error() { int foo = 5; try { throw; } catch (const std::exception& e) { ; } }");
461-
ASSERT_EQUALS("", errout.str());
461+
ASSERT_EQUALS("", errout_str());
462462
}
463463

464464
void exceptionDispatchIdiomExtraStatements() {
465465
// extra statements aside from the rethrow should be done before/after the idiom rather than inside it.
466466
check("void on_error() { try { int foo = 5; throw; } catch (...) { ; } }");
467-
ASSERT_EQUALS("[test.cpp:1]: (error) Rethrowing current exception with 'throw;', it seems there is no current exception to rethrow. If there is no current exception this calls std::terminate(). More: https://isocpp.org/wiki/faq/exceptions#throw-without-an-object\n", errout.str());
467+
ASSERT_EQUALS("[test.cpp:1]: (error) Rethrowing current exception with 'throw;', it seems there is no current exception to rethrow. If there is no current exception this calls std::terminate(). More: https://isocpp.org/wiki/faq/exceptions#throw-without-an-object\n", errout_str());
468468
}
469469

470470
void exceptionDispatchIdiomSubsequentRethrows() {
471471
// if you use the exception dispatch idiom, you have already asserted that you are in a catch block, so subsequent rethrows are valid.
472472
check("void on_error() { int foo = 5; try { throw; } catch (...) { ; } throw; }");
473-
ASSERT_EQUALS("", errout.str());
473+
ASSERT_EQUALS("", errout_str());
474474
}
475475
};
476476

0 commit comments

Comments
 (0)