Skip to content

Commit 6d28ccf

Browse files
authored
Add test for #14509 (#8480)
This was fixed by b599bb4.
1 parent 9988cd5 commit 6d28ccf

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/testunusedvar.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ class TestUnusedVar : public TestFixture {
249249
TEST_CASE(localvarDelete);
250250
TEST_CASE(localvarLambda); // #8941, #8948
251251
TEST_CASE(localvarStructuredBinding); // #10368
252+
TEST_CASE(localvarPtrToPtr);
252253

253254
TEST_CASE(localvarCppInitialization);
254255
TEST_CASE(localvarCpp11Initialization);
@@ -6958,6 +6959,16 @@ class TestUnusedVar : public TestFixture {
69586959
ASSERT_EQUALS("", errout_str());
69596960
}
69606961

6962+
void localvarPtrToPtr() {
6963+
functionVariableUsage("int main() {\n"
6964+
" int *p, **pp = &p;\n"
6965+
" int i = 123;\n"
6966+
" *pp = &i;\n"
6967+
" return *p;\n"
6968+
"}\n");
6969+
ASSERT_EQUALS("", errout_str());
6970+
}
6971+
69616972
void localvarCppInitialization() {
69626973
functionVariableUsage("void foo() {\n"
69636974
" int buf[6];\n"

0 commit comments

Comments
 (0)