Skip ast validation inside template (#2661)
This commit is contained in:
parent
7b7d96ee4c
commit
084529575f
|
@ -1564,14 +1564,17 @@ void TokenList::validateAst() const
|
|||
safeAstTokens.insert(tok);
|
||||
}
|
||||
|
||||
// Don't check templates
|
||||
if (tok->str() == "<" && tok->link()) {
|
||||
tok = tok->link();
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check binary operators
|
||||
if (Token::Match(tok, "%or%|%oror%|%assign%|%comp%")) {
|
||||
// Skip lambda captures
|
||||
if (Token::Match(tok, "= ,|]"))
|
||||
continue;
|
||||
// Don't check templates
|
||||
if (tok->link())
|
||||
continue;
|
||||
// Skip pure virtual functions
|
||||
if (Token::simpleMatch(tok->previous(), ") = 0"))
|
||||
continue;
|
||||
|
|
|
@ -8228,6 +8228,8 @@ private:
|
|||
" d e = {(p1)...};\n"
|
||||
" }\n"
|
||||
"};\n"));
|
||||
|
||||
ASSERT_NO_THROW(tokenizeAndStringify("a<b?0:1>()==3;"));
|
||||
}
|
||||
|
||||
void checkNamespaces() {
|
||||
|
|
Loading…
Reference in New Issue