| 3729 | } |
| 3730 | |
| 3731 | void privateCtor1() { |
| 3732 | { |
| 3733 | const Settings s = settingsBuilder(settings).cpp(Standards::CPP03).build(); |
| 3734 | check("class Foo {\n" |
| 3735 | " int foo;\n" |
| 3736 | " Foo() { }\n" |
| 3737 | "};", s); |
| 3738 | ASSERT_EQUALS("", errout_str()); |
| 3739 | } |
| 3740 | |
| 3741 | { |
| 3742 | const Settings s = settingsBuilder(settings).cpp(Standards::CPP11).build(); |
| 3743 | check("class Foo {\n" |
| 3744 | " int foo;\n" |
| 3745 | " Foo() { }\n" |
| 3746 | "};", s); |
| 3747 | ASSERT_EQUALS("[test.cpp:3:5]: (warning) Member variable 'Foo::foo' is not initialized in the constructor. [uninitMemberVarPrivate]\n", errout_str()); |
| 3748 | } |
| 3749 | } |
| 3750 | |
| 3751 | void privateCtor2() { |
| 3752 | check("class Foo\n" |