Skip to content

Commit 7faee9a

Browse files
committed
add test for #10343
1 parent 69d89c5 commit 7faee9a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/testsimplifytypedef.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ class TestSimplifyTypedef : public TestFixture {
243243
TEST_CASE(simplifyTypedefFunction9);
244244
TEST_CASE(simplifyTypedefFunction10); // #5191
245245
TEST_CASE(simplifyTypedefFunction11);
246+
TEST_CASE(simplifyTypedefFunction12);
246247

247248
TEST_CASE(simplifyTypedefStruct); // #12081 - volatile struct
248249

@@ -4444,6 +4445,15 @@ class TestSimplifyTypedef : public TestFixture {
44444445
ignore_errout(); // we are not interested in the output
44454446
}
44464447

4448+
void simplifyTypedefFunction12() {
4449+
const char code[] = "typedef (*pfi)(void);\n"
4450+
"pfi f;\n";
4451+
4452+
const char expected[] = "int ( * f ) ( void ) ;";
4453+
ASSERT_EQUALS(expected, tok(code, dinit(TokOptions, $.debugwarnings = false)));
4454+
ASSERT_EQUALS("", errout_str());
4455+
}
4456+
44474457
void simplifyTypedefStruct() {
44484458
const char code1[] = "typedef struct S { int x; } xyz;\n"
44494459
"xyz var;";

0 commit comments

Comments
 (0)