Skip to content

Commit 199552a

Browse files
Update testuninitvar.cpp
1 parent 92f9b2e commit 199552a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/testuninitvar.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7776,6 +7776,14 @@ class TestUninitVar : public TestFixture {
77767776
" return (&s)->y;\n"
77777777
"}\n");
77787778
ASSERT_EQUALS("[test.cpp:5:16]: (error) Uninitialized variable: s.y [uninitvar]\n", errout_str());
7779+
7780+
valueFlowUninit("struct S { int* p; };\n" // #14640
7781+
"void f() {\n"
7782+
" int x;\n"
7783+
" S s{ &x };\n"
7784+
" *s.p = 0;\n"
7785+
"}\n");
7786+
ASSERT_EQUALS("", errout_str());
77797787
}
77807788

77817789
void valueFlowUninitForLoop()

0 commit comments

Comments
 (0)