TemplateSimplifier::templateParameters: Handling r-value arguments

This commit is contained in:
Daniel Marjamäki 2016-03-18 11:09:41 +01:00
parent 100c4276ea
commit 072120d19f
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -687,6 +687,10 @@ private:
// #4010 - template reference type
const char code[] = "template<class T> struct A{}; A<int&> a;";
ASSERT_EQUALS("A<int&> a ; struct A<int&> { } ;", tok(code));
// #7409 - rvalue
const char code2[] = "template<class T> struct A{}; A<int&&> a;";
ASSERT_EQUALS("A<int&&> a ; struct A<int&&> { } ;", tok(code2));
}
void template32() {