+2005-10-28 Josh Conner <jconner@apple.com>
+
+ PR c++/22153
+ * parser.c (cp_parser_member_declaration): Detect and handle
+ a template specialization.
+
2005-10-20 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/22508
/* Check for a template-declaration. */
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TEMPLATE))
{
- /* Parse the template-declaration. */
- cp_parser_template_declaration (parser, /*member_p=*/true);
+ /* An explicit specialization here is an error condition, and we
+ expect the specialization handler to detect and report this. */
+ if (cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_LESS
+ && cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_GREATER)
+ cp_parser_explicit_specialization (parser);
+ else
+ cp_parser_template_declaration (parser, /*member_p=*/true);
return;
}
+2005-10-28 Josh Conner <jconner@apple.com>
+
+ PR c++/22153
+ * g++.dg/template/crash38.C: New test.
+ * g++.dg/parse/explicit1.C: Change expected errors.
+
2005-10-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20051021-1.c: New test.
struct foo {
template<typename T> void bar (T &t) {}
- template<> void bar<double>(double &t) {} // { dg-error "explicit|non-namespace|member" }
+ template<> void bar<double>(double &t) {} // { dg-error "non-namespace|template|function" }
};