File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -665,7 +665,7 @@ namespace {
665665 }
666666
667667 for (Token* type = start; Token::Match (type, " %name%|*|&" ); type = type->next ()) {
668- if (Token::Match (type, " %name% ;" )) {
668+ if (Token::Match (type, " %name% ;" ) && !type-> isStandardType () ) {
669669 mRangeType .first = start;
670670 mRangeType .second = type;
671671 mNameToken = type;
Original file line number Diff line number Diff line change @@ -3277,7 +3277,8 @@ class TestSimplifyTypedef : public TestFixture {
32773277 ASSERT_EQUALS (" struct X { } ; std :: vector < X > v ;" , tok (code));
32783278 }
32793279
3280- void simplifyTypedef145 () { // #11634
3280+ void simplifyTypedef145 () {
3281+ // #11634
32813282 const char * code{};
32823283 code = " int typedef i;\n "
32833284 " i main() {}\n " ;
@@ -3292,6 +3293,11 @@ class TestSimplifyTypedef : public TestFixture {
32923293 code = " struct {} typedef S;\n " // don't crash
32933294 " S();\n " ;
32943295 ASSERT_EQUALS (" struct S { } ; struct S ( ) ;" , tok (code));
3296+
3297+ // #11693
3298+ code = " typedef unsigned char unsigned char;\n " // don't hang
3299+ " void f(char);\n " ;
3300+ ASSERT_EQUALS (" void f ( char ) ;" , tok (code));
32953301 }
32963302
32973303 void simplifyTypedefFunction1 () {
You can’t perform that action at this time.
0 commit comments