TemplateSimplifier::templateParameters: Handling r-value arguments
This commit is contained in:
parent
100c4276ea
commit
072120d19f
|
@ -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)
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue