Skip to content

Commit 771cbcf

Browse files
Update testcondition.cpp
1 parent eb4b652 commit 771cbcf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎test/testcondition.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3449,6 +3449,12 @@ class TestCondition : public TestFixture {
34493449
"}\n");
34503450
ASSERT_EQUALS("", errout_str());
34513451

3452+
check("std::string a[3];\n" // #15065
3453+
"void f() {\n"
3454+
" if (a) {}\n"
3455+
"}\n");
3456+
ASSERT_EQUALS("[test.cpp:3:8]: (style) Condition 'a' is always true [knownConditionTrueFalse]\n", errout_str());
3457+
34523458
// Avoid FP when condition comes from macro
34533459
check("#define NOT !\n"
34543460
"void f() {\n"

0 commit comments

Comments
 (0)