@@ -4510,8 +4510,8 @@ class TestCondition : public TestFixture {
45104510 " void foo() {\n "
45114511 " if (bar(1) == 0 && bar(1) > 0) {}\n "
45124512 " }\n " );
4513- // TODO the isConstExpression returns false for the bar() function call
4514- // these warnings are shown if the isConstExpression is removed from the checker
4513+ // TODO handle function calls without side effects better
4514+ // these warnings are shown if isConstExpression is removed from the checker
45154515 TODO_ASSERT_EQUALS (" [test.cpp:3:16]: (style) Condition 'bar(1)==0' is always false [knownConditionTrueFalse]\n "
45164516 " [test.cpp:3:31]: (style) Condition 'bar(1)>0' is always true [knownConditionTrueFalse]\n " ,
45174517 " " ,
@@ -4590,8 +4590,8 @@ class TestCondition : public TestFixture {
45904590 " void f() {\n "
45914591 " if (g() == 1 && g() == -1) {}\n "
45924592 " }\n " );
4593- // TODO the isConstExpression returns false for the bar() function call
4594- // these warnings are shown if the isConstExpression is removed from the checker
4593+ // TODO handle function calls without side effects better
4594+ // these warnings are shown if isConstExpression is removed from the checker
45954595 TODO_ASSERT_EQUALS (" [test.cpp:3:13]: (style) Condition 'g()==1' is always false [knownConditionTrueFalse]\n "
45964596 " [test.cpp:3:25]: (style) Condition 'g()==-1' is always true [knownConditionTrueFalse]\n " ,
45974597 " " ,
@@ -4633,7 +4633,7 @@ class TestCondition : public TestFixture {
46334633 " int g() { return f(); }\n "
46344634 " int h() { if (f()) {} }\n "
46354635 " int i() { return f() == 3; }\n " );
4636- // TODO the isConstExpression thinks that the f() function call is non-const
4636+ // TODO handle function calls without side effects better
46374637 // if the isConstExpression is removed from the checker then this warning is shown
46384638 TODO_ASSERT_EQUALS (" [test.cpp:3:16]: (style) Condition 'f()' is always true [knownConditionTrueFalse]\n " ,
46394639 " " ,
@@ -4927,7 +4927,8 @@ class TestCondition : public TestFixture {
49274927 " if (b()) {}\n "
49284928 " if (!b()) {}\n "
49294929 " }\n " );
4930- // TODO the isConstExpression thinks that b() is a non constant expression
4930+ // TODO handle function calls without side effects better
4931+ // these warnings are shown if isConstExpression is removed from the checker
49314932 TODO_ASSERT_EQUALS (" [test.cpp:3:10]: (style) Condition 'b()' is always false [knownConditionTrueFalse]\n "
49324933 " [test.cpp:4:9]: (style) Condition '!b()' is always true [knownConditionTrueFalse]\n " ,
49334934 " " ,
@@ -6485,7 +6486,7 @@ class TestCondition : public TestFixture {
64856486 ASSERT_EQUALS (" " , errout_str ());
64866487
64876488 // the assignments are always false/true.. but "assignment in condition" would be a different checker
6488- // knownConditionTrueFalse should only warn if code can be removed.
6489+ // knownConditionTrueFalse should only warn if code can be removed.
64896490 check (" void f(uint32_t u) {\n " // #2490
64906491 " if ((u = 0x00000000) || (u = 0xffffffff)) {}\n "
64916492 " }\n " );
0 commit comments