if (template_p)
argument = make_unbound_class_template (TREE_OPERAND (argument, 0),
TREE_OPERAND (argument, 1),
- tf_error | tf_parsing);
+ tf_error);
else if (TREE_CODE (argument) != TEMPLATE_DECL)
cp_parser_error (parser, "expected template-name");
}
begin_explicit_instantiation ();
/* [temp.explicit] says that we are supposed to ignore access
control while processing explicit instantiation directives. */
- scope_chain->check_access = 0;
+ push_deferring_access_checks (dk_no_check);
/* Parse a decl-specifier-seq. */
decl_specifiers
= cp_parser_decl_specifier_seq (parser,
/* We're done with the instantiation. */
end_explicit_instantiation ();
/* Turn access control back on. */
- scope_chain->check_access = flag_access_control;
+ pop_deferring_access_checks ();
cp_parser_consume_semicolon_at_end_of_statement (parser);
}
standard does not seem to be definitive, but there is no other
valid interpretation of the following `::'. Therefore, those
names are considered class-names. */
- decl = TYPE_NAME (make_typename_type (scope, decl,
- tf_error | tf_parsing));
+ decl = TYPE_NAME (make_typename_type (scope, decl, tf_error));
else if (decl == error_mark_node
|| TREE_CODE (decl) != TYPE_DECL
|| !IS_AGGR_TYPE (TREE_TYPE (decl)))
saved_num_template_parameter_lists
= parser->num_template_parameter_lists;
parser->num_template_parameter_lists = 0;
+
/* Start the class. */
type = begin_class_definition (type);
if (type == error_mark_node)
/* Assume that we are looking at a constructor declarator. */
constructor_p = true;
- push_deferring_access_checks (dk_no_check);
-
/* Look for the optional `::' operator. */
cp_parser_global_scope_opt (parser,
/*current_scope_valid_p=*/false);
constructor_p = !cp_parser_error_occurred (parser);
}
- pop_deferring_access_checks ();
-
/* If we're still considering a constructor, we have to see a `(',
to begin the parameter-declaration-clause, followed by either a
`)', an `...', or a decl-specifier. We need to check for a
bool error_occurred;
the_parser = cp_parser_new ();
- push_deferring_access_checks (dk_no_deferred);
+ push_deferring_access_checks (flag_access_control
+ ? dk_no_deferred : dk_no_check);
error_occurred = cp_parser_translation_unit (the_parser);
the_parser = NULL;