File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -687,7 +687,7 @@ void Tokenizer::simplifyTypedef()
687687 }
688688
689689 // check for pointers and references
690- while (Token::Match (tokOffset, " *|&|const" )) {
690+ while (Token::Match (tokOffset, " *|&|&&| const" )) {
691691 pointers.push_back (tokOffset->str ());
692692 tokOffset = tokOffset->next ();
693693 }
Original file line number Diff line number Diff line change @@ -304,6 +304,7 @@ class TestSimplifyTokens : public TestFixture {
304304 TEST_CASE (simplifyTypedef106); // ticket #3619
305305 TEST_CASE (simplifyTypedef107); // ticket #3963 - bad code => segmentation fault
306306 TEST_CASE (simplifyTypedef108); // ticket #4777
307+ TEST_CASE (simplifyTypedef109); // ticket #1823 - rvalue reference
307308
308309 TEST_CASE (simplifyTypedefFunction1);
309310 TEST_CASE (simplifyTypedefFunction2); // ticket #1685
@@ -5725,6 +5726,16 @@ class TestSimplifyTokens : public TestFixture {
57255726 ASSERT_EQUALS (expected, tok (code));
57265727 }
57275728
5729+ void simplifyTypedef109 () {
5730+ const char code[] = " typedef int&& rref;\n "
5731+ " rref var;" ;
5732+ const char expected[] = " int & & var ;" ;
5733+
5734+ checkSimplifyTypedef (code);
5735+ ASSERT_EQUALS (expected, tok (code));
5736+ ASSERT_EQUALS (" " , errout.str ());
5737+ }
5738+
57285739 void simplifyTypedefFunction1 () {
57295740 {
57305741 const char code[] = " typedef void (*my_func)();\n "
You can’t perform that action at this time.
0 commit comments