+2005-10-11 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/21369
+ * parser.c (cp_parser_elaborated_type_specifier): Don't treat
+ class types as templates if the type is not appearing as part of a
+ type definition or declaration.
+
2005-10-10 Mark Mitchell <mark@codesourcery.com>
PR c++/24277
declaration context. */
tag_scope ts;
+ bool template_p;
+
if (is_friend)
/* Friends have special name lookup rules. */
ts = ts_within_enclosing_non_class;
warning (OPT_Wattributes,
"type attributes are honored only at type definition");
- type = xref_tag (tag_type, identifier, ts,
- parser->num_template_parameter_lists);
+ template_p =
+ (parser->num_template_parameter_lists
+ && (cp_parser_next_token_starts_class_definition_p (parser)
+ || cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)));
+ type = xref_tag (tag_type, identifier, ts, template_p);
}
}
if (tag_type != enum_type)