Incomplete statement: tweaked bailout for '0;' statement using isExpandedMacro()
This commit is contained in:
parent
7cfa54f0e0
commit
0c086cf247
|
@ -1734,7 +1734,7 @@ void CheckOther::checkIncompleteStatement()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// No warning for [;{}] (void *) 0 ;
|
// No warning for [;{}] (void *) 0 ;
|
||||||
if (Token::Match(tok, "[;{}] 0 ;") && tok->next()->isCast())
|
if (Token::Match(tok, "[;{}] 0 ;") && (tok->next()->isCast() || tok->next()->isExpandedMacro()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// bailout if there is a "? :" in this statement
|
// bailout if there is a "? :" in this statement
|
||||||
|
|
|
@ -154,6 +154,9 @@ private:
|
||||||
void void0() { // #6327
|
void void0() { // #6327
|
||||||
check("void f() { (void*)0; }");
|
check("void f() { (void*)0; }");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("void f() { $0; }");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void intarray() {
|
void intarray() {
|
||||||
|
|
Loading…
Reference in New Issue