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

View File

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