--check-headers=no: remove more templates in headers that are not used in the source file
This commit is contained in:
parent
d84dbf6b5f
commit
c5a512338e
|
@ -4327,24 +4327,26 @@ void Tokenizer::simplifyHeaders()
|
||||||
Token::eraseTokens(tok, endToken->link()->next());
|
Token::eraseTokens(tok, endToken->link()->next());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Token::simpleMatch(tok->next(), "template <")) {
|
if (Token::Match(tok->next(), "template < %name%")) {
|
||||||
const Token *tok2 = tok->tokAt(3);
|
const Token *tok2 = tok->tokAt(3);
|
||||||
while (Token::Match(tok2, "%name% %name% ,"))
|
while (Token::Match(tok2, "%name% %name% [,=>]")) {
|
||||||
tok2 = tok2->tokAt(3);
|
tok2 = tok2->tokAt(2);
|
||||||
if (Token::Match(tok2, "%name% %name% >")) {
|
if (Token::Match(tok2, "= %name% [,>]"))
|
||||||
tok2 = tok2->tokAt(3);
|
tok2 = tok2->tokAt(2);
|
||||||
if (Token::Match(tok2, "class|struct %name% [;:{]") && keep.find(tok2->strAt(1)) == keep.end()) {
|
if (tok2->str() == ",")
|
||||||
const Token *endToken = tok2->tokAt(2);
|
tok2 = tok2->next();
|
||||||
if (endToken->str() == ":") {
|
}
|
||||||
|
if (Token::Match(tok2, "> class|struct %name% [;:{]") && keep.find(tok2->strAt(2)) == keep.end()) {
|
||||||
|
const Token *endToken = tok2->tokAt(3);
|
||||||
|
if (endToken->str() == ":") {
|
||||||
|
endToken = endToken->next();
|
||||||
|
while (Token::Match(endToken, "%name%|,"))
|
||||||
endToken = endToken->next();
|
endToken = endToken->next();
|
||||||
while (Token::Match(endToken, "%name%|,"))
|
|
||||||
endToken = endToken->next();
|
|
||||||
}
|
|
||||||
if (endToken && endToken->str() == "{")
|
|
||||||
endToken = endToken->link()->next();
|
|
||||||
if (endToken && endToken->str() == ";")
|
|
||||||
Token::eraseTokens(tok, endToken);
|
|
||||||
}
|
}
|
||||||
|
if (endToken && endToken->str() == "{")
|
||||||
|
endToken = endToken->link()->next();
|
||||||
|
if (endToken && endToken->str() == ";")
|
||||||
|
Token::eraseTokens(tok, endToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue