2011-03-11 Jason Merrill <jason@redhat.com>
+ PR c++/47144
+ * parser.c (cp_parser_template_type_arg): Set
+ type_definition_forbidden_message.
+
PR c++/47808
* decl.c (compute_array_index_type): Discard folding
if it didn't produce a constant.
static tree cp_parser_template_type_arg (cp_parser *parser)
{
- return cp_parser_type_id_1 (parser, true, false);
+ tree r;
+ const char *saved_message = parser->type_definition_forbidden_message;
+ parser->type_definition_forbidden_message
+ = G_("types may not be defined in template arguments");
+ r = cp_parser_type_id_1 (parser, true, false);
+ parser->type_definition_forbidden_message = saved_message;
+ return r;
}
static tree cp_parser_trailing_type_id (cp_parser *parser)
2011-03-11 Jason Merrill <jason@redhat.com>
+ * g++.dg/parse/no-type-defn1.C: New.
+
* g++.dg/ext/attrib40.C: New.
* g++.dg/cpp0x/regress/array1.C: New.