Add another check to Tokenizer::validateC(): C++ casts
This commit is contained in:
parent
1225b4b25a
commit
e88b4dcf06
|
@ -8053,6 +8053,9 @@ void Tokenizer::validateC() const
|
|||
if (!isC())
|
||||
return;
|
||||
for (const Token *tok = tokens(); tok; tok = tok->next()) {
|
||||
// That might trigger false positives, but it's much faster to have this truncated pattern
|
||||
if (Token::simpleMatch(tok, "const_cast|dynamic_cast|reinterpret_cast|static_cast <"))
|
||||
syntaxErrorC(tok, "C++ cast <...");
|
||||
// Template function..
|
||||
if (Token::Match(tok, "%name% < %name% > (")) {
|
||||
const Token *tok2 = tok->tokAt(5);
|
||||
|
|
Loading…
Reference in New Issue