You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testautovariables.cpp
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2281,6 +2281,13 @@ class TestAutoVariables : public TestFixture {
2281
2281
"}");
2282
2282
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2] -> [test.cpp:4]: (error) Returning iterator to local container 'x' that will be invalid when returning.\n", errout.str());
2283
2283
2284
+
check("auto f() {\n"
2285
+
" std::vector<int> x;\n"
2286
+
" auto it = std::begin(x);\n"
2287
+
" return it;\n"
2288
+
"}");
2289
+
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2] -> [test.cpp:4]: (error) Returning iterator to local container 'x' that will be invalid when returning.\n", errout.str());
0 commit comments