File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ class TestSimplifyTypedef : public TestFixture {
155155 TEST_CASE (simplifyTypedefFunction7);
156156 TEST_CASE (simplifyTypedefFunction8);
157157 TEST_CASE (simplifyTypedefFunction9);
158+ TEST_CASE (simplifyTypedefFunction10); // #5191
158159
159160 TEST_CASE (simplifyTypedefShadow); // #4445 - shadow variable
160161 }
@@ -3120,6 +3121,25 @@ class TestSimplifyTypedef : public TestFixture {
31203121 }
31213122 }
31223123
3124+ void simplifyTypedefFunction10 () {
3125+ const char code[] = " enum Format_E1 { FORMAT11 FORMAT12 } Format_T1;\n "
3126+ " namespace MySpace {\n "
3127+ " enum Format_E2 { FORMAT21 FORMAT22 } Format_T2;\n "
3128+ " }\n "
3129+ " typedef Format_E1 (**PtrToFunPtr_Type1)();\n "
3130+ " typedef MySpace::Format_E2 (**PtrToFunPtr_Type2)();\n "
3131+ " PtrToFunPtr_Type1 t1;\n "
3132+ " PtrToFunPtr_Type2 t2;\n " ;
3133+ ASSERT_EQUALS (" int Format_T1 ; "
3134+ " namespace MySpace "
3135+ " { "
3136+ " int Format_T2 ; "
3137+ " } "
3138+ " int ( * * t1 ) ( ) ; "
3139+ " int ( * * t2 ) ( ) ;" ,
3140+ tok (code,false ));
3141+ }
3142+
31233143 void simplifyTypedefShadow () { // shadow variable (#4445)
31243144 const char code[] = " typedef struct { int x; } xyz;;\n "
31253145 " void f(){\n "
You can’t perform that action at this time.
0 commit comments