From 8cd2979468d46a479c8017830180486d5b1cb141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 27 Jan 2009 17:39:06 +0000 Subject: [PATCH] uninitialized member: don't check private constructors --- test/testclass.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/testclass.cpp b/test/testclass.cpp index 34ae300c7..cadab0cf6 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -45,6 +45,7 @@ private: TEST_CASE(uninitVar1); TEST_CASE(uninitVarStream); + TEST_CASE(privateCtor); // If constructor is private.. } // Check that base classes have virtual destructors @@ -179,6 +180,20 @@ private: 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)