File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ class TestAutoVariables : public TestFixture {
149149 TEST_CASE (danglingTemporaryLifetime);
150150 TEST_CASE (invalidLifetime);
151151 TEST_CASE (deadPointer);
152+ TEST_CASE (splitNamespaceAuto); // crash #10473
152153 }
153154
154155
@@ -3194,6 +3195,18 @@ class TestAutoVariables : public TestFixture {
31943195 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 ());
31953196 }
31963197
3198+ void splitNamespaceAuto () { // #10473
3199+ check (" namespace ns\n "
3200+ " {\n "
3201+ " auto var{ 0 };\n "
3202+ " }\n "
3203+ " namespace ns\n "
3204+ " {\n "
3205+ " int i;\n "
3206+ " }\n " );
3207+ ASSERT_EQUALS (" " , errout.str ());
3208+ }
3209+
31973210};
31983211
31993212REGISTER_TEST (TestAutoVariables)
You can’t perform that action at this time.
0 commit comments