uninitialized member: don't check private constructors

This commit is contained in:
Daniel Marjamäki 2009-01-27 17:39:06 +00:00
parent 762ae69304
commit 8cd2979468
1 changed files with 15 additions and 0 deletions

View File

@ -45,6 +45,7 @@ private:
TEST_CASE(uninitVar1); TEST_CASE(uninitVar1);
TEST_CASE(uninitVarStream); TEST_CASE(uninitVarStream);
TEST_CASE(privateCtor); // If constructor is private..
} }
// Check that base classes have virtual destructors // Check that base classes have virtual destructors
@ -179,6 +180,20 @@ private:
ASSERT_EQUALS(std::string(""), errout.str()); ASSERT_EQUALS(std::string(""), errout.str());
} }
void privateCtor()
{
checkUninitVar("class Foo {\n"
" int foo;\n"
" Foo() { }\n"
"};\n");
ASSERT_EQUALS(std::string(""), errout.str());
}
}; };
REGISTER_TEST(TestClass) REGISTER_TEST(TestClass)