Skip to content

Commit 2de1880

Browse files
Update testvalueflow.cpp
1 parent a426d91 commit 2de1880

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/testvalueflow.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,6 +3257,17 @@ class TestValueFlow : public TestFixture {
32573257
" if (x) {}\n"
32583258
"}\n";
32593259
ASSERT_EQUALS(true, testValueOfXKnown(code, 5U, 0));
3260+
3261+
code = "struct S {\n" // #13844
3262+
" int x{};\n"
3263+
" template <typename T>\n"
3264+
" void f(T t) {\n"
3265+
" x = 0;\n"
3266+
" t();\n"
3267+
" if (x == 0) {}\n"
3268+
" }\n"
3269+
"};\n";
3270+
ASSERT_EQUALS(false, testValueOfXKnown(code, 7U, 0));
32603271
}
32613272

32623273
void valueFlowAfterSwap()

0 commit comments

Comments
 (0)