Tokenizer: Add 'enum struct' pattern
This commit is contained in:
parent
055d111ee9
commit
15eb53b403
|
@ -2247,7 +2247,7 @@ bool Tokenizer::simplifyUsing()
|
||||||
if (Settings::terminated())
|
if (Settings::terminated())
|
||||||
return substitute;
|
return substitute;
|
||||||
|
|
||||||
if (Token::simpleMatch(tok, "enum class")) {
|
if (Token::Match(tok, "enum class|struct")) {
|
||||||
Token *bodyStart = tok;
|
Token *bodyStart = tok;
|
||||||
while (Token::Match(bodyStart, "%name%|:|::|<")) {
|
while (Token::Match(bodyStart, "%name%|:|::|<")) {
|
||||||
if (bodyStart->str() == "<")
|
if (bodyStart->str() == "<")
|
||||||
|
@ -2440,7 +2440,7 @@ bool Tokenizer::simplifyUsing()
|
||||||
|
|
||||||
// check for enum with body
|
// check for enum with body
|
||||||
if (tok1->str() == "enum") {
|
if (tok1->str() == "enum") {
|
||||||
if (Token::simpleMatch(tok1, "enum class"))
|
if (Token::Match(tok1, "enum class|struct"))
|
||||||
tok1 = tok1->next();
|
tok1 = tok1->next();
|
||||||
Token *defStart = tok1;
|
Token *defStart = tok1;
|
||||||
while (Token::Match(defStart, "%name%|::|:"))
|
while (Token::Match(defStart, "%name%|::|:"))
|
||||||
|
|
Loading…
Reference in New Issue