Fix varid0 with rvalue reference typedef (#5649)
This commit is contained in:
parent
328daeceb4
commit
2d232dcaac
|
@ -656,7 +656,7 @@ namespace {
|
|||
}
|
||||
}
|
||||
|
||||
for (Token* type = start; Token::Match(type, "%name%|*|&"); type = type->next()) {
|
||||
for (Token* type = start; Token::Match(type, "%name%|*|&|&&"); type = type->next()) {
|
||||
if (type != start && Token::Match(type, "%name% ;") && !type->isStandardType()) {
|
||||
mRangeType.first = start;
|
||||
mRangeType.second = type;
|
||||
|
@ -892,7 +892,7 @@ namespace {
|
|||
|
||||
// Unsplit variable declarations
|
||||
if (tok4 && tok4->isSplittedVarDeclEq() &&
|
||||
((tok4->isCpp() && Token::Match(tok4->tokAt(-2), "& %name% ;")) || Token::Match(tok4->previous(), "] ; %name% = {"))) {
|
||||
((tok4->isCpp() && Token::Match(tok4->tokAt(-2), "&|&& %name% ;")) || Token::Match(tok4->previous(), "] ; %name% = {"))) {
|
||||
tok4->deleteNext();
|
||||
tok4->deleteThis();
|
||||
}
|
||||
|
|
|
@ -2517,7 +2517,7 @@ private:
|
|||
void simplifyTypedef109() {
|
||||
const char code[] = "typedef int&& rref;\n"
|
||||
"rref var = 0;";
|
||||
const char expected[] = "int && var ; var = 0 ;";
|
||||
const char expected[] = "int && var = 0 ;";
|
||||
ASSERT_EQUALS(expected, tok(code));
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue