From abf92e26999957d1b373ec56fd0bc8dc3dc5e272 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 9 Jul 2002 19:45:37 -0400 Subject: [PATCH] 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: r55352 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/decl.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 465716da0692..70066d18d41d 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-09 Mark Mitchell * cp-tree.h (constructor_name_p): Declare it. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b5d18b4c67cf..11d8fe58b804 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6072,7 +6072,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