File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3163,13 +3163,21 @@ class TestUninitVar : public TestFixture {
31633163 ASSERT_EQUALS (" " , errout_str ());
31643164 }
31653165
3166- void uninitvar12 () { // 10218
3167- const char code[] = " void fp() {\n "
3166+ void uninitvar12 () {
3167+ const char code[] = " void fp() {\n " // 10218
31683168 " std::stringstream ss;\n "
31693169 " for (int i; ss >> i;) {}\n "
31703170 " }" ;
31713171 checkUninitVar (code);
31723172 ASSERT_EQUALS (" " , errout_str ());
3173+
3174+ const char code2[] = " void f() {\n " // #13908
3175+ " int* i = new int;\n "
3176+ " std::cout << i << \" , \" << *i;\n "
3177+ " delete i;\n "
3178+ " }\n " ;
3179+ checkUninitVar (code2);
3180+ ASSERT_EQUALS (" [test.cpp:3:32]: (error) Memory is allocated but not initialized: i [uninitdata]\n " , errout_str ());
31733181 }
31743182
31753183 void uninitvar13 () { // #9772 - FP
You can’t perform that action at this time.
0 commit comments