Skip to content

Commit 859a381

Browse files
Update testautovariables.cpp
1 parent a9f88d4 commit 859a381

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/testautovariables.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,13 @@ class TestAutoVariables : public TestFixture {
570570
" *s = &a[0];\n"
571571
"}\n");
572572
ASSERT_EQUALS("", errout_str());
573+
574+
check("void f(int* p[]) {\n" // #7167
575+
" int a[4] = { 1, 2, 3 };\n"
576+
" p[0] = a;\n"
577+
"};\n");
578+
ASSERT_EQUALS("[test.cpp:3:5]: (error) Address of local auto-variable assigned to a function parameter. [autoVariables]\n",
579+
errout_str());
573580
}
574581

575582
void testautovar_normal() {

0 commit comments

Comments
 (0)