We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9f88d4 commit 859a381Copy full SHA for 859a381
test/testautovariables.cpp
@@ -570,6 +570,13 @@ class TestAutoVariables : public TestFixture {
570
" *s = &a[0];\n"
571
"}\n");
572
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());
580
}
581
582
void testautovar_normal() {
0 commit comments