From: Jason Merrill Date: Tue, 9 Jul 2002 23:46:07 +0000 (-0400) Subject: re PR c++/6255 (ICE with templatess) X-Git-Tag: releases/gcc-3.1.1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e709855f47b32fbf351e7a0a3cc6fce1cb13400;p=thirdparty%2Fgcc.git re PR c++/6255 (ICE with templatess) PR c++/6255 * decl.c (lookup_name_real): Build a new TYPENAME_TYPE rather than modifying the old one. From-SVN: r55353 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c926d3c0e174..ec6bea21db98 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2002-07-10 Jason Merrill + + PR c++/6255 + * decl.c (lookup_name_real): Build a new TYPENAME_TYPE rather than + modifying the old one. + 2002-07-08 Kriang Lerdsuwanakij * pt.c (can_complete_type_without_circularity): Add static to diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9f683f2ef846..82ec357bd9c2 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6101,7 +6101,13 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only) if (got_scope && got_scope != type && val && TREE_CODE (val) == TYPE_DECL && TREE_CODE (TREE_TYPE (val)) == TYPENAME_TYPE) - TYPE_CONTEXT (TREE_TYPE (val)) = got_scope; + { + val = TREE_TYPE (val); + val = build_typename_type (got_scope, name, + TYPENAME_TYPE_FULLNAME (val), + TREE_TYPE (val)); + val = TYPE_STUB_DECL (val); + } } } else