diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index ab84ab1c9..0d3d18852 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -276,7 +276,7 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok) return 0; // * / const - while (Token::Match(tok, "*|&|const")) + while (Token::Match(tok, "*|&|&&|const")) tok = tok->next(); if (!tok) diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index 00de7f55f..45ec22af5 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -687,6 +687,10 @@ private: // #4010 - template reference type const char code[] = "template struct A{}; A a;"; ASSERT_EQUALS("A a ; struct A { } ;", tok(code)); + + // #7409 - rvalue + const char code2[] = "template struct A{}; A a;"; + ASSERT_EQUALS("A a ; struct A { } ;", tok(code2)); } void template32() {