Merge overlapping patterns

This commit is contained in:
Dmitry-Me 2020-02-04 18:35:30 +03:00
parent 84f65c40a7
commit c8df734c07
1 changed files with 2 additions and 4 deletions

View File

@ -2950,8 +2950,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
assert(mTokenList.validateToken(tok2)); // that assertion fails on examples from #6021 assert(mTokenList.validateToken(tok2)); // that assertion fails on examples from #6021
const Token *startToken = tok2; const Token *startToken = tok2;
while (Token::Match(startToken->tokAt(-2), "%name% :: %name%") || while (Token::Match(startToken->tokAt(-2), ">|%name% :: %name%")) {
Token::Match(startToken->tokAt(-2), "> :: %name%")) {
if (startToken->strAt(-2) == ">") { if (startToken->strAt(-2) == ">") {
const Token * tok3 = startToken->tokAt(-2)->findOpeningBracket(); const Token * tok3 = startToken->tokAt(-2)->findOpeningBracket();
if (tok3) if (tok3)
@ -3012,8 +3011,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
assert(mTokenList.validateToken(tok2)); // that assertion fails on examples from #6021 assert(mTokenList.validateToken(tok2)); // that assertion fails on examples from #6021
Token *startToken = tok2; Token *startToken = tok2;
while (Token::Match(startToken->tokAt(-2), "%name% :: %name%") || while (Token::Match(startToken->tokAt(-2), ">|%name% :: %name%")) {
Token::Match(startToken->tokAt(-2), "> :: %name%")) {
if (startToken->strAt(-2) == ">") { if (startToken->strAt(-2) == ">") {
const Token * tok3 = startToken->tokAt(-2)->findOpeningBracket(); const Token * tok3 = startToken->tokAt(-2)->findOpeningBracket();
if (tok3) if (tok3)