Fix todo test that was using wrong function (#3982)

* Fix todo test that was using wrong function

* Format
This commit is contained in:
Paul Fultz II 2022-04-06 23:48:51 -05:00 committed by GitHub
parent 74667d1e2a
commit 8986cf018f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -2318,18 +2318,19 @@ private:
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:3]: (error) Returning iterator that will be invalid when returning.\n",
errout.str());
check("std::vector<int> f();\n"
check("std::vector<int> g();\n"
"auto f() {\n"
" auto it = g().begin();\n"
" return it;\n"
"}");
TODO_ASSERT_EQUALS("error", "", errout.str());
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:4]: (error) Returning iterator that will be invalid when returning.\n",
errout.str());
check("std::vector<int> f();\n"
check("std::vector<int> g();\n"
"int& f() {\n"
" return *g().begin();\n"
"}");
TODO_ASSERT_EQUALS("error", "", errout.str());
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:3]: (error) Reference to temporary returned.\n", errout.str());
check("struct A {\n"
" std::vector<std::string> v;\n"