summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorlerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-10 11:29:53 +0000
committerlerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-10 11:29:53 +0000
commit4cab827378a185ff1e30c02d681312f510ce8fa9 (patch)
treec56f80b0b8d2950e80b44d92a5f02235bdc24b54 /gcc/cp/pt.c
parent4f62c42e4d56c0363e3cc647167bf2cc6a428f56 (diff)
downloadgcc-4cab827378a185ff1e30c02d681312f510ce8fa9.tar.gz
PR c++/9252
* cp-tree.h (saved_scope): Remove check_access field. (tsubst_flags_t): Remove tf_parsing. * decl.c (maybe_push_to_top_level): Don't initialize scope_chain->check_access. (make_typename_type, make_unbound_class_template): Don't use tf_parsing. (register_dtor_fn): Use push/pop_deferring_access_checks instead of scope_chain->check_access. * method.c (use_thunk): Likewise. * parser.c (cp_parser_explicit_instantiation (cp_parser_constructor_declarator_p): Don't call push/pop_deferring_access_checks here. (cp_parser_template_argument, cp_parser_class_name): Don't use tf_parsing. (yyparse): Check flag_access_control. * pt.c (instantiate_class_template): Call push/pop_deferring_access_checks. * semantics.c (push_deferring_access_checks): Propagate dk_no_check. (perform_or_defer_access_check): Make sure basetype_path is a type before comparison. * call.c (build_op_delete_call, build_over_call): Use perform_or_defer_access_check. * class.c (alter_access): Likewise. * init.c (build_offset_ref): Likewise. * lex.c (do_identifier): Likewise. * method.c (hack_identifier): Likewise. * search.c (lookup_member): Likewise. * semantics.c (finish_non_static_data_member): Likewise. (simplify_aggr_init_exprs_r): Use push/pop_deferring_access_checks instead of flag_access_control. * g++.dg/parse/access8.C: New test. * g++.dg/parse/access9.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66660 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 03548262b68..972bdab265a 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5259,6 +5259,10 @@ instantiate_class_template (type)
the process of being defined. */
TYPE_BEING_DEFINED (type) = 1;
+ /* We may be in the middle of deferred access check. Disable
+ it now. */
+ push_deferring_access_checks (dk_no_deferred);
+
maybe_push_to_top_level (uses_template_parms (type));
if (t)
@@ -5568,6 +5572,7 @@ instantiate_class_template (type)
popclass ();
pop_from_top_level ();
+ pop_deferring_access_checks ();
pop_tinst_level ();
if (TYPE_CONTAINS_VPTR_P (type))