+2006-11-18 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/29022
+ PR c++/27316
+ PR c++/28740
+ * parser.c (cp_parser_class_head): Move processing
+ of any base classes to...
+ (cp_parser_class_specifier) ...here. Take an extra
+ tree* parameter for the base classes. Only process
+ them if the opening brace was found.
+
2006-12-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/30022
static tree cp_parser_class_specifier
(cp_parser *);
static tree cp_parser_class_head
- (cp_parser *, bool *, tree *);
+ (cp_parser *, bool *, tree *, tree *);
static enum tag_types cp_parser_class_key
(cp_parser *);
static void cp_parser_member_specification_opt
unsigned saved_num_template_parameter_lists;
tree old_scope = NULL_TREE;
tree scope = NULL_TREE;
+ tree bases;
push_deferring_access_checks (dk_no_deferred);
/* Parse the class-head. */
type = cp_parser_class_head (parser,
&nested_name_specifier_p,
- &attributes);
+ &attributes,
+ &bases);
/* If the class-head was a semantic disaster, skip the entire body
of the class. */
if (!type)
return error_mark_node;
}
+ /* Process the base classes. */
+ xref_basetypes (type, bases);
+
/* Issue an error message if type-definitions are forbidden here. */
cp_parser_check_type_definition (parser);
/* Remember that we are defining one more class. */
static tree
cp_parser_class_head (cp_parser* parser,
bool* nested_name_specifier_p,
- tree *attributes_p)
+ tree *attributes_p,
+ tree *bases)
{
tree nested_name_specifier;
enum tag_types class_key;
bool invalid_explicit_specialization_p = false;
tree pushed_scope = NULL_TREE;
unsigned num_templates;
- tree bases;
/* Assume no nested-name-specifier will be present. */
*nested_name_specifier_p = false;
struct A::C : B {};
is valid. */
- bases = NULL_TREE;
+ *bases = NULL_TREE;
/* Get the list of base-classes, if there is one. */
if (cp_lexer_next_token_is (parser->lexer, CPP_COLON))
- bases = cp_parser_base_clause (parser);
-
- /* Process the base classes. */
- xref_basetypes (type, bases);
+ *bases = cp_parser_base_clause (parser);
done:
/* Leave the scope given by the nested-name-specifier. We will