Skip to content

Commit c8c25bb

Browse files
Update testsimplifytypedef.cpp
1 parent 36b8eb5 commit c8c25bb

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

test/testsimplifytypedef.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ class TestSimplifyTypedef : public TestFixture {
230230
TEST_CASE(simplifyTypedef157);
231231
TEST_CASE(simplifyTypedef158);
232232
TEST_CASE(simplifyTypedef159);
233+
TEST_CASE(simplifyTypedef160);
233234

234235
TEST_CASE(simplifyTypedefFunction1);
235236
TEST_CASE(simplifyTypedefFunction2); // ticket #1685
@@ -3812,6 +3813,28 @@ class TestSimplifyTypedef : public TestFixture {
38123813
ASSERT_EQUALS(exp, tok(code));
38133814
}
38143815

3816+
void simplifyTypedef160() {
3817+
const char code[] = "struct S1 {};\n"
3818+
"typedef struct S1 S2;\n"
3819+
"namespace N {\n"
3820+
" struct B {\n"
3821+
" explicit B(int& i);\n"
3822+
" };\n"
3823+
" struct S2 : B {\n"
3824+
" explicit S2(int& i) : B(i) {}\n"
3825+
" };\n"
3826+
"}\n";
3827+
const char exp[] = "struct S1 { } ; "
3828+
"namespace N { "
3829+
"struct B { "
3830+
"explicit B ( int & i ) ; } ; "
3831+
"struct S2 : B { "
3832+
"explicit S2 ( int & i ) : B ( i ) { } "
3833+
"} ;"
3834+
" }";
3835+
ASSERT_EQUALS(exp, tok(code));
3836+
}
3837+
38153838
void simplifyTypedefFunction1() {
38163839
{
38173840
const char code[] = "typedef void (*my_func)();\n"

0 commit comments

Comments
 (0)