MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / privateCtor1

Method privateCtor1

test/testconstructors.cpp:3731–3749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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"

Callers

nothing calls this directly

Calls 2

buildMethod · 0.80
cppMethod · 0.80

Tested by

no test coverage detected