Skip to content

Commit 395c8f0

Browse files
Update testvalueflow.cpp
1 parent d6b62da commit 395c8f0

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
@@ -4119,6 +4119,15 @@ class TestValueFlow : public TestFixture {
41194119
"}\n";
41204120
ASSERT_EQUALS(true, testValueOfX(code, 4U, 0));
41214121
ASSERT_EQUALS(false, testValueOfXImpossible(code, 4U, 0));
4122+
4123+
code = "double f(double d, bool b) {\n" // #14734
4124+
" double s = 0.0;\n"
4125+
" if (b)\n"
4126+
" s += d;\n"
4127+
" return s > 0.0 ? s : 0.0;\n"
4128+
"}\n";
4129+
auto values = tokenValues(code, "s :", ValueFlow::Value::ValueType::FLOAT);
4130+
ASSERT_EQUALS(0, values.size());
41224131
}
41234132

41244133
void valueFlowForwardLambda() {

0 commit comments

Comments
 (0)