Fix issue 9340: AST broken: endless recursion from '{' (#2161)

This commit is contained in:
Paul Fultz II 2019-09-09 14:35:49 -05:00 committed by Daniel Marjamäki
parent e7ff983fe0
commit 9753e18ebd
2 changed files with 10 additions and 0 deletions

View File

@ -769,6 +769,7 @@ static void compilePrecedence2(Token *&tok, AST_state& state)
compileUnaryOp(tok, state, compileScope);
} else if (tok->str() == "...") {
state.op.push(tok);
tok = tok->next();
break;
} else if (tok->str() == "." && tok->strAt(1) != "*") {
if (tok->strAt(1) == ".") {

View File

@ -7840,6 +7840,15 @@ private:
"};\n"
"template <class> struct F;\n"
"int main() { using T = void (*)(a<j<F, char[]>>); }\n"))
// #9340
ASSERT_NO_THROW(tokenizeAndStringify(
"struct a {\n"
" template <class... b> void c(b... p1) {\n"
" using d = a;\n"
" d e = {(p1)...};\n"
" }\n"
"};\n"))
}
void checkNamespaces() {