From 072120d19f14f0b7e7872b13c9bc8221f01d6bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 18 Mar 2016 11:09:41 +0100 Subject: [PATCH] TemplateSimplifier::templateParameters: Handling r-value arguments --- lib/templatesimplifier.cpp | 2 +- test/testsimplifytemplate.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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() {