]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/13445 (Template argument replacement "dereferences" a typedef)
authorNathan Sidwell <nathan@codesourcery.com>
Tue, 30 Dec 2003 09:47:32 +0000 (09:47 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 30 Dec 2003 09:47:32 +0000 (09:47 +0000)
cp:
PR c++/13445
* pt.c (instantiate_class_template): Push to class's scope before
tsubsting base.
testsuite:
PR c++/13445
* g++.dg/template/scope2.C: New test.

From-SVN: r75223

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

index 9de401759067d9db5f36041796b7a77081721dca..8b3c92b66d590013d8a033ca83016d986e0807a7 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-11  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/13445
+       * pt.c (instantiate_class_template): Push to class's scope before
+       tsubsting base.
+
 2003-12-28  Roger Sayle  <roger@eyesopen.com>
 
        PR c++/13070
index e90b7ed825c5801d0686f363d479d6420f7b6272..3000847879e57f0ac2ef3488a923dadc4bb399e3 100644 (file)
@@ -5383,8 +5383,14 @@ instantiate_class_template (type)
     {
       tree base_list = NULL_TREE;
       tree pbases = TYPE_BINFO_BASETYPES (pattern);
+      tree context = TYPE_CONTEXT (type);
       int i;
 
+      /* We must enter the scope containing the type, as that is where
+        the accessibility of types named in dependent bases are
+        looked up from.  */
+      push_scope (context ? context : global_namespace);
+      
       /* Substitute into each of the bases to determine the actual
         basetypes.  */
       for (i = 0; i < TREE_VEC_LENGTH (pbases); ++i)
@@ -5429,6 +5435,8 @@ instantiate_class_template (type)
       /* Now call xref_basetypes to set up all the base-class
         information.  */
       xref_basetypes (type, base_list);
+      
+      pop_scope (context ? context : global_namespace);
     }
 
   /* Now that our base classes are set up, enter the scope of the
index dbb8fef876e78a29e989e066a77b04d4175891cd..52217a05f72c61250db69aa2dba852f5dabbb064 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-29  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/13445
+       * g++.dg/template/scope2.C: New test.
+
 2003-12-28  Roger Sayle  <roger@eyesopen.com>
 
        PR c++/13070