Tokenizer: Add 'enum struct' pattern

This commit is contained in:
Daniel Marjamäki 2021-08-30 20:18:06 +02:00
parent 055d111ee9
commit 15eb53b403
1 changed files with 2 additions and 2 deletions

View File

@ -2247,7 +2247,7 @@ bool Tokenizer::simplifyUsing()
if (Settings::terminated())
return substitute;
if (Token::simpleMatch(tok, "enum class")) {
if (Token::Match(tok, "enum class|struct")) {
Token *bodyStart = tok;
while (Token::Match(bodyStart, "%name%|:|::|<")) {
if (bodyStart->str() == "<")
@ -2440,7 +2440,7 @@ bool Tokenizer::simplifyUsing()
// check for enum with body
if (tok1->str() == "enum") {
if (Token::simpleMatch(tok1, "enum class"))
if (Token::Match(tok1, "enum class|struct"))
tok1 = tok1->next();
Token *defStart = tok1;
while (Token::Match(defStart, "%name%|::|:"))