@@ -207,6 +207,7 @@ class TestSimplifyTemplate : public TestFixture {
207207 TEST_CASE (template162);
208208 TEST_CASE (template163); // #9685 syntax error
209209 TEST_CASE (template164); // #9394
210+ TEST_CASE (template162); // #10032 syntax error
210211 TEST_CASE (template_specialization_1); // #7868 - template specialization template <typename T> struct S<C<T>> {..};
211212 TEST_CASE (template_specialization_2); // #7868 - template specialization template <typename T> struct S<C<T>> {..};
212213 TEST_CASE (template_enum); // #6299 Syntax error in complex enum declaration (including template)
@@ -4161,6 +4162,22 @@ class TestSimplifyTemplate : public TestFixture {
41614162 ASSERT_EQUALS (exp, tok (code));
41624163 }
41634164
4165+ void template165 () { // #10032 syntax error
4166+ const char code[] = " struct MyStruct {\n "
4167+ " template<class T>\n "
4168+ " bool operator()(const T& l, const T& r) const {\n "
4169+ " return l.first < r.first;\n "
4170+ " }\n "
4171+ " };" ;
4172+ const char exp[] = " struct MyStruct { "
4173+ " template < class T > "
4174+ " bool operator() ( const T & l , const T & r ) const { "
4175+ " return l . first < r . first ; "
4176+ " } "
4177+ " } ;" ;
4178+ ASSERT_EQUALS (exp, tok (code));
4179+ }
4180+
41644181 void template_specialization_1 () { // #7868 - template specialization template <typename T> struct S<C<T>> {..};
41654182 const char code[] = " template <typename T> struct C {};\n "
41664183 " template <typename T> struct S {a};\n "
0 commit comments