OSDN Git Service

PR c++/19632
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Feb 2005 20:22:23 +0000 (20:22 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Feb 2005 20:22:23 +0000 (20:22 +0000)
        * pt.c (get_mostly_instantiated_function_type): Save and restore
        flag_access_control instead of push/pop_access_scope.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94889 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/pt.c

index 971baca..9e67a94 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-11  Richard Henderson  <rth@redhat.com>
+
+       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  <mark@codesourcery.com>
 
        PR c++/19755
index dbe560b..d484c8b 100644 (file)
@@ -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;