Skip to content

Commit c08008b

Browse files
Update testvalueflow.cpp
1 parent a511b33 commit c08008b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/testvalueflow.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,15 @@ class TestValueFlow : public TestFixture {
17421742
values = tokenValues(code, "( D )");
17431743
ASSERT_EQUALS(1U, values.size());
17441744
TODO_ASSERT_EQUALS(2 * settings.platform.sizeof_pointer, 1, values.back().intvalue);
1745+
1746+
code = "int f() {\n" // #11335
1747+
" int* a[2];"
1748+
" return sizeof(a);\n"
1749+
"}";
1750+
values = tokenValues(code, "( a");
1751+
ASSERT_EQUALS(1U, values.size());
1752+
ASSERT_EQUALS(16, values.back().intvalue);
1753+
ASSERT_EQUALS_ENUM(ValueFlow::Value::ValueKind::Known, values.back().valueKind);
17451754
}
17461755

17471756
void valueFlowComma()

0 commit comments

Comments
 (0)