parent
29bbb4ce14
commit
2d3b8d7003
|
@ -149,6 +149,7 @@ private:
|
|||
TEST_CASE(danglingTemporaryLifetime);
|
||||
TEST_CASE(invalidLifetime);
|
||||
TEST_CASE(deadPointer);
|
||||
TEST_CASE(splitNamespaceAuto); // crash #10473
|
||||
}
|
||||
|
||||
|
||||
|
@ -3194,6 +3195,18 @@ private:
|
|||
ASSERT_EQUALS("[test.cpp:5] -> [test.cpp:4] -> [test.cpp:8]: (error) Using pointer to local variable 'x' that is out of scope.\n", errout.str());
|
||||
}
|
||||
|
||||
void splitNamespaceAuto() { // #10473
|
||||
check("namespace ns\n"
|
||||
"{\n"
|
||||
" auto var{ 0 };\n"
|
||||
"}\n"
|
||||
"namespace ns\n"
|
||||
"{\n"
|
||||
" int i;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
REGISTER_TEST(TestAutoVariables)
|
||||
|
|
Loading…
Reference in New Issue