Skip to content

Commit 21ed807

Browse files
committed
CheckCondition::alwaysTrueFalseError: put condition in single quotes.
1 parent 251f6d2 commit 21ed807

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/checkcondition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,5 +1012,5 @@ void CheckCondition::alwaysTrueFalseError(const Token *tok, bool knownResult)
10121012
reportError(tok,
10131013
Severity::style,
10141014
"knownConditionTrueFalse",
1015-
"Condition " + expr + " is always " + (knownResult ? "true" : "false"));
1015+
"Condition '" + expr + "' is always " + (knownResult ? "true" : "false"));
10161016
}

test/testcondition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ class TestCondition : public TestFixture {
15191519
" if (a) { return; }\n" // <- this is just here to fool simplifyKnownVariabels
15201520
" if (!x) {}\n"
15211521
"}");
1522-
ASSERT_EQUALS("[test.cpp:4]: (style) Condition !x is always true\n", errout.str());
1522+
ASSERT_EQUALS("[test.cpp:4]: (style) Condition '!x' is always true\n", errout.str());
15231523

15241524
check("void f() {\n" // #6898 (Token::expressionString)
15251525
" int x = 0;\n"

0 commit comments

Comments
 (0)