This commit is contained in:
Alexander Mai 2014-09-06 22:27:38 +02:00
commit e4d0435976
2 changed files with 12 additions and 1 deletions

View File

@ -687,7 +687,7 @@ void Tokenizer::simplifyTypedef()
}
// check for pointers and references
while (Token::Match(tokOffset, "*|&|const")) {
while (Token::Match(tokOffset, "*|&|&&|const")) {
pointers.push_back(tokOffset->str());
tokOffset = tokOffset->next();
}

View File

@ -304,6 +304,7 @@ private:
TEST_CASE(simplifyTypedef106); // ticket #3619
TEST_CASE(simplifyTypedef107); // ticket #3963 - bad code => segmentation fault
TEST_CASE(simplifyTypedef108); // ticket #4777
TEST_CASE(simplifyTypedef109); // ticket #1823 - rvalue reference
TEST_CASE(simplifyTypedefFunction1);
TEST_CASE(simplifyTypedefFunction2); // ticket #1685
@ -5725,6 +5726,16 @@ private:
ASSERT_EQUALS(expected, tok(code));
}
void simplifyTypedef109() {
const char code[] = "typedef int&& rref;\n"
"rref var;";
const char expected[] = "int & & var ;";
checkSimplifyTypedef(code);
ASSERT_EQUALS(expected, tok(code));
ASSERT_EQUALS("", errout.str());
}
void simplifyTypedefFunction1() {
{
const char code[] = "typedef void (*my_func)();\n"