Skip to content

Commit

Permalink
Add test for #11731
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Aug 11, 2023
1 parent 98afe8e commit ff08154
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/testuninitvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6160,6 +6160,15 @@ class TestUninitVar : public TestFixture {
" init(s2.s1.a);\n"
"}\n");
ASSERT_EQUALS("", errout.str());

valueFlowUninit("struct S { int i; };\n" // #11731
"void f(const S*& p);\n"
"int g() {\n"
" const S* s;\n"
" f(s);\n"
" return s->i;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}

void valueFlowUninitBreak() { // Do not show duplicate warnings about the same uninitialized value
Expand Down

0 comments on commit ff08154

Please sign in to comment.