@@ -210,6 +210,7 @@ class TestSimplifyTemplate : public TestFixture {
210210 TEST_CASE (template165); // #10032 syntax error
211211 TEST_CASE (template166); // #10081 hang
212212 TEST_CASE (template167);
213+ TEST_CASE (template168);
213214 TEST_CASE (template_specialization_1); // #7868 - template specialization template <typename T> struct S<C<T>> {..};
214215 TEST_CASE (template_specialization_2); // #7868 - template specialization template <typename T> struct S<C<T>> {..};
215216 TEST_CASE (template_enum); // #6299 Syntax error in complex enum declaration (including template)
@@ -4218,6 +4219,51 @@ class TestSimplifyTemplate : public TestFixture {
42184219 ASSERT_EQUALS (exp, tok (code));
42194220 }
42204221
4222+ void template168 () {
4223+ const char code[] = " template < typename T, typename U > struct type { };\n "
4224+ " template < > struct type < bool, bool > {};\n "
4225+ " template < > struct type < unsigned char, unsigned char > {};\n "
4226+ " template < > struct type < char, char > {};\n "
4227+ " template < > struct type < signed char, signed char > {};\n "
4228+ " template < > struct type < unsigned short, unsigned short > {};\n "
4229+ " template < > struct type < short, short > {};\n "
4230+ " template < > struct type < unsigned int, unsigned int > {};\n "
4231+ " template < > struct type < int, int > {};\n "
4232+ " template < > struct type < unsigned long long, unsigned long long > {};\n "
4233+ " template < > struct type < long long, long long > {};\n "
4234+ " template < > struct type < double, double > {};\n "
4235+ " template < > struct type < float, float > {};\n "
4236+ " template < > struct type < long double, long double > {};" ;
4237+ const char exp[] = " struct type<longdouble,longdouble> ; "
4238+ " struct type<float,float> ; "
4239+ " struct type<double,double> ; "
4240+ " struct type<longlong,longlong> ; "
4241+ " struct type<unsignedlonglong,unsignedlonglong> ; "
4242+ " struct type<int,int> ; "
4243+ " struct type<unsignedint,unsignedint> ; "
4244+ " struct type<short,short> ; "
4245+ " struct type<unsignedshort,unsignedshort> ; "
4246+ " struct type<signedchar,signedchar> ; "
4247+ " struct type<char,char> ; "
4248+ " struct type<unsignedchar,unsignedchar> ; "
4249+ " struct type<bool,bool> ; "
4250+ " template < typename T , typename U > struct type { } ; "
4251+ " struct type<bool,bool> { } ; "
4252+ " struct type<unsignedchar,unsignedchar> { } ; "
4253+ " struct type<char,char> { } ; "
4254+ " struct type<signedchar,signedchar> { } ; "
4255+ " struct type<unsignedshort,unsignedshort> { } ; "
4256+ " struct type<short,short> { } ; "
4257+ " struct type<unsignedint,unsignedint> { } ; "
4258+ " struct type<int,int> { } ; "
4259+ " struct type<unsignedlonglong,unsignedlonglong> { } ; "
4260+ " struct type<longlong,longlong> { } ; "
4261+ " struct type<double,double> { } ; "
4262+ " struct type<float,float> { } ; "
4263+ " struct type<longdouble,longdouble> { } ;" ;
4264+ ASSERT_EQUALS (exp, tok (code));
4265+ }
4266+
42214267 void template_specialization_1 () { // #7868 - template specialization template <typename T> struct S<C<T>> {..};
42224268 const char code[] = " template <typename T> struct C {};\n "
42234269 " template <typename T> struct S {a};\n "
0 commit comments