From e0b64ec7a91aeab613955262bba2aa5932047938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 12 Dec 2018 19:00:14 +0100 Subject: [PATCH] Fixed #8884 (AST: handle xs... template argument) --- lib/tokenlist.cpp | 2 ++ test/testtokenize.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index a712458d2..669a1258a 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -591,6 +591,8 @@ static void compileTerm(Token *&tok, AST_state& state) state.op.push(tok); if (Token::Match(tok, "%name% <") && tok->linkAt(1)) tok = tok->linkAt(1); + else if (Token::Match(tok, "%name% . . .")) + tok = tok->tokAt(3); tok = tok->next(); if (Token::Match(tok, "%str%")) { while (Token::Match(tok, "%name%|%str%")) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 34dcf27e9..36d9dc421 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -8546,6 +8546,8 @@ private: // This two unit tests were added to avoid a crash. The actual correct AST result for non-executable code has not been determined so far. ASSERT_EQUALS("Cpublica::b:::", testAst("class C : public ::a::b { };")); ASSERT_EQUALS("AB: f( abc+=", testAst("struct A : public B { void f() { a=b+c; } };")); + + ASSERT_EQUALS("xfts(=", testAst("; auto x = f(ts...);")); } void astcast() {