+2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/58535
+ * parser.c (cp_parser_function_specifier_opt): Upon error about
+ virtual templates don't set ds_virtual.
+ (finish_fully_implicit_template): Reject virtual implicit templates.
+
2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58565
A member function template shall not be virtual. */
if (PROCESSING_REAL_TEMPLATE_DECL_P ())
error_at (token->location, "templates may not be %<virtual%>");
- set_and_check_decl_spec_loc (decl_specs, ds_virtual, token);
+ else
+ set_and_check_decl_spec_loc (decl_specs, ds_virtual, token);
break;
case RID_EXPLICIT:
{
gcc_assert (parser->fully_implicit_function_template_p);
+ if (member_decl_opt && member_decl_opt != error_mark_node
+ && DECL_VIRTUAL_P (member_decl_opt))
+ {
+ error_at (DECL_SOURCE_LOCATION (member_decl_opt),
+ "implicit templates may not be %<virtual%>");
+ DECL_VIRTUAL_P (member_decl_opt) = false;
+ }
+
pop_deferring_access_checks ();
if (member_decl_opt)
member_decl_opt = finish_member_template_decl (member_decl_opt);
+2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/58535
+ * g++.dg/parse/crash65.C: New.
+ * g++.dg/cpp1y/pr58535.C: Likewise.
+
2013-10-02 Richard Biener <rguenther@suse.de>
* gcc.dg/tree-ssa/ldist-11.c: Adjust.