cstyleCast: don't warn about '(const Variable *)nullptr'
This commit is contained in:
parent
7242e661ef
commit
a85eacc157
|
@ -282,7 +282,8 @@ void CheckOther::warningOldStylePointerCast()
|
||||||
if (tok->strAt(3) == "const")
|
if (tok->strAt(3) == "const")
|
||||||
tok = tok->next();
|
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;
|
continue;
|
||||||
|
|
||||||
// Is "type" a class?
|
// Is "type" a class?
|
||||||
|
|
Loading…
Reference in New Issue