Skip to content

Commit 1011c11

Browse files
committed
add test
1 parent 6198191 commit 1011c11

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎test/testsimplifyusing.cpp‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class TestSimplifyUsing : public TestFixture {
102102
TEST_CASE(simplifyUsing10720);
103103
TEST_CASE(simplifyUsing13873); // function declaration
104104
TEST_CASE(simplifyUsing14877);
105+
TEST_CASE(simplifyUsingMacroName);
105106

106107
TEST_CASE(scopeInfo1);
107108
TEST_CASE(scopeInfo2);
@@ -1725,6 +1726,16 @@ class TestSimplifyUsing : public TestFixture {
17251726
ASSERT_EQUALS(expected, tok(code));
17261727
}
17271728

1729+
void simplifyUsingMacroName() {
1730+
const char code[] = "#define A int\n"
1731+
"using F = void (*)(A x);\n"
1732+
"void f(F g);\n";
1733+
const Settings settings = settingsBuilder(settings0).cpp(Standards::CPPLatest).build();
1734+
SimpleTokenizer2 tokenizer(settings, *this, code, "test.cpp");
1735+
ASSERT(tokenizer.simplifyTokens1(""));
1736+
ASSERT_EQUALS("void f ( void ( * g ) ( $int ) ) ;", tokenizer.tokens()->stringifyList(false, true, false, false, false));
1737+
}
1738+
17281739
void scopeInfo1() {
17291740
const char code[] = "struct A {\n"
17301741
" enum class Mode { UNKNOWN, ENABLED, NONE, };\n"

0 commit comments

Comments
 (0)