Simplify rValue reference arguments without name (&& -> & &)
This commit is contained in:
parent
8db0790407
commit
39b64ea5fb
|
@ -3493,6 +3493,14 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
|
|||
|
||||
elseif();
|
||||
|
||||
// Simplify nameless rValue references - named ones are simplified later
|
||||
for (Token* tok = list.front(); tok; tok = tok->next()) {
|
||||
if (Token::Match(tok, "&& [,)]")) {
|
||||
tok->str("&");
|
||||
tok->insertToken("&");
|
||||
}
|
||||
}
|
||||
|
||||
validate();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4795,6 +4795,9 @@ private:
|
|||
tokenizeDebugListing("class C {\n"
|
||||
" C(int&& a);\n"
|
||||
"};"));
|
||||
|
||||
ASSERT_EQUALS("\n\n##file 0\n"
|
||||
"1: void foo ( int & & ) ;\n", tokenizeDebugListing("void foo(int&&);"));
|
||||
}
|
||||
|
||||
void varid_arrayFuncPar() {
|
||||
|
|
Loading…
Reference in New Issue