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/teststl.cpp
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2345,6 +2345,15 @@ class TestStl : public TestFixture {
2345
2345
" } \n"
2346
2346
"}\n");
2347
2347
ASSERT_EQUALS("", errout_str());
2348
+
2349
+
check("std::string g1();\n"// #12520
2350
+
"const std::string& g2();\n"
2351
+
"void f() {\n"
2352
+
" g1().erase(g1().begin());\n"
2353
+
" g2().erase(g2().begin());\n"
2354
+
"}\n");
2355
+
ASSERT_EQUALS("[test.cpp:4:7]: (error) Iterator 'g1().begin()' referring to temporary container 'g1()' is used with temporary container 'g1()'. [mismatchingContainerIterator]\n",
0 commit comments