TestConstructors: Unremove a test case

This commit is contained in:
Daniel Marjamäki 2020-11-22 18:17:40 +01:00
parent 2cd8ea83a7
commit f6e7a66f42
1 changed files with 13 additions and 0 deletions

View File

@ -348,6 +348,19 @@ private:
" int x;\n"
"};");
ASSERT_EQUALS("", errout.str());
const char code[] = "template <class T> struct A {\n"
" A<T>() : x(0) { }\n"
" A<T>(const T & t) : x(t.x) { }\n"
"private:\n"
" int x;\n"
" int y;\n"
"};";
check(code);
ASSERT_EQUALS("", errout.str());
check((code + std::string("A<int> a(10);")).c_str());
ASSERT_EQUALS("[test.cpp:2]: (warning) Member variable 'A < int >::y' is not initialized in the constructor.\n"
"[test.cpp:3]: (warning) Member variable 'A < int >::y' is not initialized in the constructor.\n", errout.str());
}
void simple7() { // ticket #4531