2014-12-09 Jason Merrill <jason@redhat.com>
+ PR c++/64129
+ * decl.c (grokdeclarator): Recover from variable template
+ specialization declared as function.
+
PR c++/64222
* parser.c (cp_parser_unqualified_id): Don't declare fname while
parsing function parms.
return error_mark_node;
}
+ if (TREE_CODE (unqualified_id) == TEMPLATE_ID_EXPR)
+ {
+ tree tmpl = TREE_OPERAND (unqualified_id, 0);
+ if (variable_template_p (tmpl))
+ {
+ error ("specialization of variable template %qD "
+ "declared as function", tmpl);
+ inform (DECL_SOURCE_LOCATION (tmpl),
+ "variable template declared here");
+ return error_mark_node;
+ }
+ }
+
/* Tell grokfndecl if it needs to set TREE_PUBLIC on the node. */
function_context = (ctype != NULL_TREE) ?
decl_function_context (TYPE_MAIN_DECL (ctype)) : NULL_TREE;