Skip to content

Commit

Permalink
Update testclass.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Apr 19, 2024
1 parent 353b5aa commit 3852cc9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/testclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7636,6 +7636,15 @@ class TestClass : public TestFixture {
" int a, b{};\n"
"};");
ASSERT_EQUALS("", errout_str());

checkInitializerListOrder("class Foo {\n" // #3524
"public:\n"
" Foo(int arg) : a(b), b(arg) {}\n"
" int a;\n"
" int b;\n"
"};\n");
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:4]: (style, inconclusive) Member variable 'Foo::a' uses an uninitialized argument 'b' due to the order of declarations.\n",
errout_str());
}

#define checkInitializationListUsage(code) checkInitializationListUsage_(code, __FILE__, __LINE__)
Expand Down

0 comments on commit 3852cc9

Please sign in to comment.