aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorScott Brumbaugh <scottb.lists@verizon.net>2004-07-03 02:19:27 +0000
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>2004-07-03 02:19:27 +0000
commitece95d900ed3c5224e591f3eb98234945aa3b942 (patch)
tree99ab5461a3e7691bb95fa81acf5604562d732ade /gcc/cp
parent50c6431753ab7961b4330c5f3c7e611ad81e9178 (diff)
downloadgcc-ece95d900ed3c5224e591f3eb98234945aa3b942.zip
gcc-ece95d900ed3c5224e591f3eb98234945aa3b942.tar.gz
gcc-ece95d900ed3c5224e591f3eb98234945aa3b942.tar.bz2
re PR c++/3761 (ICE in check_template_shadow, at cp/pt.c:2013, with friend and strange class hierarchy)
PR c++/3761 * name-lookup.c (push_class_level_binding): Don't pass a TREE_LIST of ambiguous names to check_template_shadow as it only handles declarations. Instead, pull the declaration out and pass that. PR c++/3761 * g++.dg/lookup/crash4.C: New test. From-SVN: r84045
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/name-lookup.c13
2 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cd5dc66..8baadc0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2004-07-03 Scott Brumbaugh <scottb.lists@verizon.net>
+
+ PR c++/3761
+ * name-lookup.c (push_class_level_binding): Don't pass a
+ TREE_LIST of ambiguous names to check_template_shadow as it
+ only handles declarations. Instead, pull the declaration
+ out and pass that.
+
2004-07-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/14971
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index e449631..ef16689 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -2777,7 +2777,18 @@ push_class_level_binding (tree name, tree x)
/* Make sure that this new member does not have the same name
as a template parameter. */
if (TYPE_BEING_DEFINED (current_class_type))
- check_template_shadow (x);
+ {
+ tree decl = x;
+
+ /* We could have been passed a tree list if this is an ambiguous
+ declaration. If so, pull the declaration out because
+ check_template_shadow will not handle a TREE_LIST. */
+ if (TREE_CODE (decl) == TREE_LIST
+ && TREE_TYPE (decl) == error_mark_node)
+ decl = TREE_VALUE (decl);
+
+ check_template_shadow (decl);
+ }
/* [class.mem]