From: Nathan Sidwell Date: Tue, 30 Dec 2003 09:47:32 +0000 (+0000) Subject: re PR c++/13445 (Template argument replacement "dereferences" a typedef) X-Git-Tag: releases/gcc-3.3.3~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa2714432f84022088808119709cfa4d528e576d;p=thirdparty%2Fgcc.git re PR c++/13445 (Template argument replacement "dereferences" a typedef) 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9de401759067..8b3c92b66d59 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-12-11 Nathan Sidwell + + PR c++/13445 + * pt.c (instantiate_class_template): Push to class's scope before + tsubsting base. + 2003-12-28 Roger Sayle PR c++/13070 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index e90b7ed825c5..3000847879e5 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dbb8fef876e7..52217a05f72c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-12-29 Nathan Sidwell + + PR c++/13445 + * g++.dg/template/scope2.C: New test. + 2003-12-28 Roger Sayle PR c++/13070