Skip to content

Commit ecc0611

Browse files
Update testsimplifytemplate.cpp
1 parent 8cb66cf commit ecc0611

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

test/testsimplifytemplate.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class TestSimplifyTemplate : public TestFixture {
224224
TEST_CASE(template180);
225225
TEST_CASE(template181);
226226
TEST_CASE(template182); // #13770
227+
TEST_CASE(template183);
227228
TEST_CASE(template_specialization_1); // #7868 - template specialization template <typename T> struct S<C<T>> {..};
228229
TEST_CASE(template_specialization_2); // #7868 - template specialization template <typename T> struct S<C<T>> {..};
229230
TEST_CASE(template_specialization_3);
@@ -4678,6 +4679,25 @@ class TestSimplifyTemplate : public TestFixture {
46784679
ASSERT_EQUALS(exp, tok(code));
46794680
}
46804681

4682+
void template183() { // #11498
4683+
const char code[] = "template <typename T>\n"
4684+
"struct S {\n"
4685+
" void f();\n"
4686+
" using X = decltype(&S<T>::f);\n"
4687+
"private:\n"
4688+
" X x;\n"
4689+
"};\n"
4690+
"S<int> s;\n";
4691+
const char exp[] = "struct S<int> ; "
4692+
"S<int> s ; "
4693+
"struct S<int> { "
4694+
"void f ( ) ; "
4695+
"private: "
4696+
"decltype ( & S<int> :: f ) x ; "
4697+
"} ;";
4698+
ASSERT_EQUALS(exp, tok(code));
4699+
}
4700+
46814701
void template_specialization_1() { // #7868 - template specialization template <typename T> struct S<C<T>> {..};
46824702
const char code[] = "template <typename T> struct C {};\n"
46834703
"template <typename T> struct S {a};\n"

0 commit comments

Comments
 (0)