diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index e525bdd7609..5f48baea018 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -1623,7 +1623,7 @@ static Token * createAstAtToken(Token *tok) if (Token::Match(tok, "%type%") && !Token::Match(tok, "return|throw|if|while|new|delete")) { bool isStandardTypeOrQualifier = false; Token* type = tok; - while (Token::Match(type, "%type%|*|&|<")) { + while (Token::Match(type, "%type%|*|&|&&|<")) { if (type->isName() && (type->isStandardType() || Token::Match(type, "const|mutable|static|volatile"))) isStandardTypeOrQualifier = true; if (type->str() == "<") { diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 9b816a357b7..7b2bee0d80e 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -7527,6 +7527,7 @@ class TestTokenizer : public TestFixture { void astfuncdecl() { ASSERT_EQUALS("", testAst("bool operator==(const S& a, const S& b);", AstStyle::Simple, ListSimplification::Full)); ASSERT_EQUALS("", testAst("::int32_t f();")); + ASSERT_EQUALS("", testAst("void f(int&& var);")); } void astarrayinit() { // #11738