Incomplete statement: tweaked bailout for '(void*)0' using isCasted()
This commit is contained in:
parent
1b2a23b3fe
commit
de1a91f30d
|
@ -1733,8 +1733,8 @@ void CheckOther::checkIncompleteStatement()
|
|||
if (Token::Match(tok->next(), "%num% [,.]"))
|
||||
continue;
|
||||
|
||||
// No warning for [;{}] 0 ;
|
||||
if (Token::Match(tok, "[;{}] 0 ;"))
|
||||
// No warning for [;{}] (void *) 0 ;
|
||||
if (Token::Match(tok, "[;{}] 0 ;") && tok->next()->isCasted())
|
||||
continue;
|
||||
|
||||
// bailout if there is a "? :" in this statement
|
||||
|
|
|
@ -152,7 +152,7 @@ private:
|
|||
}
|
||||
|
||||
void void0() { // #6327
|
||||
check("void f() { 0; }");
|
||||
check("void f() { (void*)0; }");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue