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 26da798 commit fe3bf91Copy full SHA for fe3bf91
test/testuninitvar.cpp
@@ -7502,6 +7502,16 @@ class TestUninitVar : public TestFixture {
7502
" int len = strlen(arr);\n"
7503
"}\n");
7504
ASSERT_EQUALS("[test.cpp:8]: (error) Uninitialized variable: arr\n", errout_str());
7505
+
7506
+ valueFlowUninit("struct S1 { int x; };\n" // #12401
7507
+ "struct S2 { struct S1 s1; };\n"
7508
+ "struct S2 f() {\n"
7509
+ " struct S2 s2;\n"
7510
+ " struct S1* s1 = &s2.s1;\n"
7511
+ " s1->x = 0;\n"
7512
+ " return s2;\n"
7513
+ "}\n");
7514
+ ASSERT_EQUALS("", errout_str());
7515
}
7516
7517
void uninitvar_memberfunction() {
0 commit comments