Incomplete statement: tweaked bailout for '0;' statement using isExpandedMacro()

This commit is contained in:
Daniel Marjamäki 2014-12-24 21:47:37 +01:00
parent 7cfa54f0e0
commit 0c086cf247
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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() {