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 {
155
155
TEST_CASE (simplifyTypedefFunction7);
156
156
TEST_CASE (simplifyTypedefFunction8);
157
157
TEST_CASE (simplifyTypedefFunction9);
158
+ TEST_CASE (simplifyTypedefFunction10); // #5191
158
159
159
160
TEST_CASE (simplifyTypedefShadow); // #4445 - shadow variable
160
161
}
@@ -3120,6 +3121,25 @@ class TestSimplifyTypedef : public TestFixture {
3120
3121
}
3121
3122
}
3122
3123
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
+
3123
3143
void simplifyTypedefShadow () { // shadow variable (#4445)
3124
3144
const char code[] = " typedef struct { int x; } xyz;;\n "
3125
3145
" void f(){\n "
You can’t perform that action at this time.
0 commit comments