cstyleCast: don't warn about '(const Variable *)nullptr'

This commit is contained in:
Daniel Marjamäki 2016-10-18 22:56:33 +02:00
parent 7242e661ef
commit a85eacc157
1 changed files with 2 additions and 1 deletions

View File

@ -282,7 +282,8 @@ void CheckOther::warningOldStylePointerCast()
if (tok->strAt(3) == "const")
tok = tok->next();
if (tok->strAt(4) == "0") // Casting nullpointers is safe
const Token *p = tok->tokAt(4);
if (p->hasKnownIntValue() && p->values.front().intvalue==0) // Casting nullpointers is safe
continue;
// Is "type" a class?