diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index e077c0219c0..6f9a2530a0c 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -1128,7 +1128,9 @@ void Tokenizer::simplifyTypedef() { // remove typedefs for (auto &t: typedefs) { - if (!t.second.replaceFailed()) { + if (t.second.replaceFailed()) { + syntaxError(t.second.getTypedefToken()); + } else { const Token* const typedefToken = t.second.getTypedefToken(); TypedefInfo typedefInfo; typedefInfo.name = t.second.name();