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
+12-5Lines changed: 12 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -663,7 +663,10 @@ class TestAutoVariables : public TestFixture {
663
663
" struct S s;\n"
664
664
" g(&s);\n"
665
665
"}");
666
-
ASSERT_EQUALS("[test.cpp:4]: (error) Address of local auto-variable assigned to a function parameter.\n", errout.str());
666
+
ASSERT_EQUALS(
667
+
"[test.cpp:4]: (error) Address of local auto-variable assigned to a function parameter.\n"
668
+
"[test.cpp:4]: (error) Address of local auto-variable assigned to a function parameter.\n", // duplicate
669
+
errout.str());
667
670
}
668
671
669
672
voidtestinvaliddealloc() {
@@ -2508,7 +2511,8 @@ class TestAutoVariables : public TestFixture {
2508
2511
" }\n"
2509
2512
"};");
2510
2513
ASSERT_EQUALS(
2511
-
"[test.cpp:6] -> [test.cpp:6] -> [test.cpp:6] -> [test.cpp:4] -> [test.cpp:7]: (error) Non-local variable 'm' will use object that points to local variable 'x'.\n",
2514
+
"[test.cpp:6] -> [test.cpp:6] -> [test.cpp:6] -> [test.cpp:4] -> [test.cpp:7]: (error) Non-local variable 'm' will use object that points to local variable 'x'.\n"
2515
+
"[test.cpp:6] -> [test.cpp:6] -> [test.cpp:6] -> [test.cpp:4] -> [test.cpp:7]: (error) Non-local variable 'm' will use object that points to local variable 'x'.\n", // duplicate
@@ -3795,7 +3799,8 @@ class TestAutoVariables : public TestFixture {
3795
3799
" return v;\n"
3796
3800
"}");
3797
3801
ASSERT_EQUALS(
3798
-
"[test.cpp:3] -> [test.cpp:3] -> [test.cpp:2] -> [test.cpp:4]: (error) Returning object that points to local variable 'i' that will be invalid when returning.\n",
3802
+
"[test.cpp:3] -> [test.cpp:3] -> [test.cpp:2] -> [test.cpp:4]: (error) Returning object that points to local variable 'i' that will be invalid when returning.\n"
3803
+
"[test.cpp:3] -> [test.cpp:3] -> [test.cpp:2] -> [test.cpp:4]: (error) Returning object that points to local variable 'i' that will be invalid when returning.\n", // duplicate
3799
3804
errout.str());
3800
3805
3801
3806
check("std::vector<int*> f() {\n"
@@ -3804,15 +3809,17 @@ class TestAutoVariables : public TestFixture {
3804
3809
" return v;\n"
3805
3810
"}");
3806
3811
ASSERT_EQUALS(
3807
-
"[test.cpp:3] -> [test.cpp:3] -> [test.cpp:2] -> [test.cpp:4]: (error) Returning object that points to local variable 'i' that will be invalid when returning.\n",
3812
+
"[test.cpp:3] -> [test.cpp:3] -> [test.cpp:2] -> [test.cpp:4]: (error) Returning object that points to local variable 'i' that will be invalid when returning.\n"
3813
+
"[test.cpp:3] -> [test.cpp:3] -> [test.cpp:2] -> [test.cpp:4]: (error) Returning object that points to local variable 'i' that will be invalid when returning.\n", // duplicate
3808
3814
errout.str());
3809
3815
3810
3816
check("std::vector<int*> f() {\n"
3811
3817
" int i = 0;\n"
3812
3818
" return {&i, &i};\n"
3813
3819
"}");
3814
3820
ASSERT_EQUALS(
3815
-
"[test.cpp:3] -> [test.cpp:3] -> [test.cpp:2] -> [test.cpp:3]: (error) Returning object that points to local variable 'i' that will be invalid when returning.\n",
3821
+
"[test.cpp:3] -> [test.cpp:3] -> [test.cpp:2] -> [test.cpp:3]: (error) Returning object that points to local variable 'i' that will be invalid when returning.\n"
3822
+
"[test.cpp:3] -> [test.cpp:3] -> [test.cpp:2] -> [test.cpp:3]: (error) Returning object that points to local variable 'i' that will be invalid when returning.\n", // duplicate
0 commit comments