Fix issue 9340: AST broken: endless recursion from '{' (#2161)
This commit is contained in:
parent
e7ff983fe0
commit
9753e18ebd
|
@ -769,6 +769,7 @@ static void compilePrecedence2(Token *&tok, AST_state& state)
|
||||||
compileUnaryOp(tok, state, compileScope);
|
compileUnaryOp(tok, state, compileScope);
|
||||||
} else if (tok->str() == "...") {
|
} else if (tok->str() == "...") {
|
||||||
state.op.push(tok);
|
state.op.push(tok);
|
||||||
|
tok = tok->next();
|
||||||
break;
|
break;
|
||||||
} else if (tok->str() == "." && tok->strAt(1) != "*") {
|
} else if (tok->str() == "." && tok->strAt(1) != "*") {
|
||||||
if (tok->strAt(1) == ".") {
|
if (tok->strAt(1) == ".") {
|
||||||
|
|
|
@ -7840,6 +7840,15 @@ private:
|
||||||
"};\n"
|
"};\n"
|
||||||
"template <class> struct F;\n"
|
"template <class> struct F;\n"
|
||||||
"int main() { using T = void (*)(a<j<F, char[]>>); }\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() {
|
void checkNamespaces() {
|
||||||
|
|
Loading…
Reference in New Issue