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
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -3591,7 +3591,7 @@ class TestAutoVariables : public TestFixture {
3591
3591
" }\n"
3592
3592
" *p = 0;\n"
3593
3593
"}\n");
3594
-
ASSERT_EQUALS("[test.cpp:5:13] -> [test.cpp:2:9] -> [test.cpp:7:6]: (error) Static variable 'p' will use pointer to local variable 'a'. [danglingLifetime]\n", errout_str());
3594
+
ASSERT_EQUALS("[test.cpp:5:13] -> [test.cpp:4:9] -> [test.cpp:2:9] -> [test.cpp:7:6]: (error) Static variable 'p' will use pointer to local variable 'a'. [danglingLifetime]\n", errout_str());
3595
3595
3596
3596
// #10902
3597
3597
check("void f() {\n"
@@ -4330,7 +4330,7 @@ class TestAutoVariables : public TestFixture {
ASSERT_EQUALS("[test.cpp:6:12] -> [test.cpp:4:47] -> [test.cpp:3:22] -> [test.cpp:1:58] -> [test.cpp:4:40] -> [test.cpp:9:34] -> [test.cpp:9:34] -> [test.cpp:10:11]: (error) Using object that is a temporary. [danglingTemporaryLifetime]\n", errout_str());
4333
+
ASSERT_EQUALS("[test.cpp:6:12] -> [test.cpp:4:47] -> [test.cpp:3:22] -> [test.cpp:1:58] -> [test.cpp:4:40] -> [test.cpp:3:24] -> [test.cpp:9:34] -> [test.cpp:9:34] -> [test.cpp:10:11]: (error) Using object that is a temporary. [danglingTemporaryLifetime]\n", errout_str());
4334
4334
4335
4335
check("struct C {\n"// #9194
4336
4336
" const int& m;\n"
@@ -4692,7 +4692,7 @@ class TestAutoVariables : public TestFixture {
4692
4692
" }\n"
4693
4693
" f();\n"
4694
4694
"}\n");
4695
-
ASSERT_EQUALS("[test.cpp:5:25] -> [test.cpp:4:13] -> [test.cpp:7:5]: (error) Using lambda that captures local variable 'b' that is out of scope. [invalidLifetime]\n", errout_str());
4695
+
ASSERT_EQUALS("[test.cpp:5:25] -> [test.cpp:3:11] -> [test.cpp:4:13] -> [test.cpp:7:5]: (error) Using lambda that captures local variable 'b' that is out of scope. [invalidLifetime]\n", errout_str());
4696
4696
4697
4697
check("void f(bool b) {\n"
4698
4698
" int* x;\n"
@@ -4703,7 +4703,7 @@ class TestAutoVariables : public TestFixture {
4703
4703
" x[3];\n"
4704
4704
"}\n");
4705
4705
ASSERT_EQUALS(
4706
-
"[test.cpp:5:9] -> [test.cpp:4:9] -> [test.cpp:7:3]: (error) Using pointer to local variable 'y' that is out of scope. [invalidLifetime]\n",
4706
+
"[test.cpp:5:9] -> [test.cpp:3:6] -> [test.cpp:4:9] -> [test.cpp:7:3]: (error) Using pointer to local variable 'y' that is out of scope. [invalidLifetime]\n",
4707
4707
errout_str());
4708
4708
4709
4709
check("void foo(int a) {\n"
@@ -4893,7 +4893,7 @@ class TestAutoVariables : public TestFixture {
4893
4893
" }\n"
4894
4894
" *p = 0;\n"
4895
4895
"}\n");
4896
-
ASSERT_EQUALS("[test.cpp:5:9] -> [test.cpp:4:9] -> [test.cpp:7:4]: (error) Using pointer to local variable 'x' that is out of scope. [invalidLifetime]\n", errout_str());
4896
+
ASSERT_EQUALS("[test.cpp:5:9] -> [test.cpp:3:7] -> [test.cpp:4:9] -> [test.cpp:7:4]: (error) Using pointer to local variable 'x' that is out of scope. [invalidLifetime]\n", errout_str());
4897
4897
4898
4898
// FP: don't warn in subfunction
4899
4899
check("void f(struct KEY *key) {\n"
@@ -4934,7 +4934,7 @@ class TestAutoVariables : public TestFixture {
4934
4934
" dosth();\n"
4935
4935
"}\n");
4936
4936
ASSERT_EQUALS(
4937
-
"[test.cpp:5:24] -> [test.cpp:3:47] -> [test.cpp:4:26] -> [test.cpp:7:9]: (error) Using pointer to local variable 'item' that is out of scope. [invalidLifetime]\n",
4937
+
"[test.cpp:5:24] -> [test.cpp:3:47] -> [test.cpp:3:47] -> [test.cpp:4:26] -> [test.cpp:7:9]: (error) Using pointer to local variable 'item' that is out of scope. [invalidLifetime]\n",
4938
4938
errout_str());
4939
4939
4940
4940
// #6575
@@ -4960,7 +4960,7 @@ class TestAutoVariables : public TestFixture {
4960
4960
" return 0;\n"
4961
4961
"}\n");
4962
4962
ASSERT_EQUALS(
4963
-
"[test.cpp:5:16] -> [test.cpp:7:10] -> [test.cpp:4:13] -> [test.cpp:8:17]: (error) Using pointer to local variable 'x' that is out of scope. [invalidLifetime]\n",
4963
+
"[test.cpp:5:16] -> [test.cpp:3:8] -> [test.cpp:7:10] -> [test.cpp:4:13] -> [test.cpp:8:17]: (error) Using pointer to local variable 'x' that is out of scope. [invalidLifetime]\n",
4964
4964
errout_str());
4965
4965
4966
4966
// #11753
@@ -4972,7 +4972,7 @@ class TestAutoVariables : public TestFixture {
4972
4972
" }\n"
4973
4973
" std::cout << s;\n"
4974
4974
"}\n");
4975
-
ASSERT_EQUALS("[test.cpp:5:26] -> [test.cpp:4:14] -> [test.cpp:7:18]: (error) Using pointer to local variable 'buff' that is out of scope. [invalidLifetime]\n", errout_str());
4975
+
ASSERT_EQUALS("[test.cpp:5:26] -> [test.cpp:3:14] -> [test.cpp:4:14] -> [test.cpp:7:18]: (error) Using pointer to local variable 'buff' that is out of scope. [invalidLifetime]\n", errout_str());
0 commit comments