Fixed one more syntax error FP related to #8390

This commit is contained in:
Daniel Marjamäki 2018-03-22 15:20:37 +01:00
parent 3d4b773fd1
commit 5a444f764b
2 changed files with 6 additions and 4 deletions

View File

@ -8398,10 +8398,11 @@ void Tokenizer::findGarbageCode() const
if (!templateEndToken) {
if (tok->str() == "<" && isCPP())
templateEndToken = tok->findClosingBracket();
} else if (templateEndToken == tok) {
templateEndToken = nullptr;
} else if (Token::Match(tok, "> %cop%")) {
continue;
} else {
if (templateEndToken == tok)
templateEndToken = nullptr;
if (Token::Match(tok, "> %cop%"))
continue;
}
if (Token::Match(tok, "%cop%|=|,|[ %or%|%oror%|/|%"))
syntaxError(tok);

View File

@ -1457,6 +1457,7 @@ private:
ASSERT_THROW(checkCode(inp), InternalError);
checkCode("template<class T> struct S : A< B<T> || C<T> > {};"); // No syntax error: #8390
checkCode("static_assert(A<x> || B<x>, ab);");
}
void garbageCode188() { // #8255