From fae6e24644e6d5f24fb5503cb607ddf7b242633b Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 11 Feb 2005 12:22:23 -0800 Subject: [PATCH] re PR c++/19634 (Infinite memory usage on Alpha) PR c++/19632 * pt.c (get_mostly_instantiated_function_type): Save and restore flag_access_control instead of push/pop_access_scope. From-SVN: r94889 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/pt.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 971bacafc7e..9e67a94fc0d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-02-11 Richard Henderson + + PR c++/19632 + * pt.c (get_mostly_instantiated_function_type): Save and restore + flag_access_control instead of push/pop_access_scope. + 2005-02-10 Mark Mitchell PR c++/19755 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index dbe560b8606..d484c8b75c7 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11693,7 +11693,7 @@ get_mostly_instantiated_function_type (tree decl) ; else { - int i; + int i, save_access_control; tree partial_args; /* Replace the innermost level of the TARGS with NULL_TREEs to @@ -11706,12 +11706,10 @@ get_mostly_instantiated_function_type (tree decl) TMPL_ARGS_DEPTH (targs), make_tree_vec (DECL_NTPARMS (tmpl))); - /* Make sure that we can see identifiers, and compute access - correctly. We can just use the context of DECL for the - partial substitution here. It depends only on outer template - parameters, regardless of whether the innermost level is - specialized or not. */ - push_access_scope (decl); + /* Disable access control as this function is used only during + name-mangling. */ + save_access_control = flag_access_control; + flag_access_control = 0; ++processing_template_decl; /* Now, do the (partial) substitution to figure out the @@ -11726,7 +11724,7 @@ get_mostly_instantiated_function_type (tree decl) TREE_VEC_LENGTH (partial_args)--; tparms = tsubst_template_parms (tparms, partial_args, tf_error); - pop_access_scope (decl); + flag_access_control = save_access_control; } return fn_type; -- 2.30.2