Skip to content

Commit 42910b8

Browse files
committed
fix
1 parent f3605ae commit 42910b8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎lib/tokenize.cpp‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,15 @@ namespace {
579579
continue;
580580
if (Token::Match(tok->previous(), "struct|class|enum|union"))
581581
continue;
582+
// shadowing typedef is not recursive
583+
for (const Token *lookback = mTypedefToken->previous(); lookback; lookback = lookback->previous()) {
584+
if (lookback->str() == "}")
585+
lookback = lookback->link();
586+
else if (lookback->str() == "{") {
587+
mFail = true;
588+
return;
589+
}
590+
}
582591
throw InternalError(tok, "recursive typedef encountered");
583592
}
584593
};

0 commit comments

Comments
 (0)