Fixed #8884 (AST: handle xs... template argument)

This commit is contained in:
Daniel Marjamäki 2018-12-12 19:00:14 +01:00
parent 1a6c3bb30e
commit e0b64ec7a9
2 changed files with 4 additions and 0 deletions

View File

@ -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%"))

View File

@ -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<bool> { };"));
ASSERT_EQUALS("AB: f( abc+=", testAst("struct A : public B<C*> { void f() { a=b+c; } };"));
ASSERT_EQUALS("xfts(=", testAst("; auto x = f(ts...);"));
}
void astcast() {