Fix todo test that was using wrong function (#3982)
* Fix todo test that was using wrong function * Format
This commit is contained in:
parent
74667d1e2a
commit
8986cf018f
|
@ -2318,18 +2318,19 @@ private:
|
||||||
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:3]: (error) Returning iterator that will be invalid when returning.\n",
|
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:3]: (error) Returning iterator that will be invalid when returning.\n",
|
||||||
errout.str());
|
errout.str());
|
||||||
|
|
||||||
check("std::vector<int> f();\n"
|
check("std::vector<int> g();\n"
|
||||||
"auto f() {\n"
|
"auto f() {\n"
|
||||||
" auto it = g().begin();\n"
|
" auto it = g().begin();\n"
|
||||||
" return it;\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"
|
"int& f() {\n"
|
||||||
" return *g().begin();\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"
|
check("struct A {\n"
|
||||||
" std::vector<std::string> v;\n"
|
" std::vector<std::string> v;\n"
|
||||||
|
|
Loading…
Reference in New Issue