aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>2004-06-15 01:46:21 +0000
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>2004-06-15 01:46:21 +0000
commitc566721f93bb378064b5101a9d5156ce6018159b (patch)
tree91d0c8dd9e53f1a3ff47738322bdf184f3022066 /gcc/cp
parent4e0f4df508db6bccfdca88a2bcf26e03317d4c71 (diff)
downloadgcc-c566721f93bb378064b5101a9d5156ce6018159b.zip
gcc-c566721f93bb378064b5101a9d5156ce6018159b.tar.gz
gcc-c566721f93bb378064b5101a9d5156ce6018159b.tar.bz2
re PR c++/15967 (ICE on ambiguous operator new in class hierarchy)
PR c++/15967 * search.c (lookup_field): Propagate the ambiguity list. (lookup_fnfields): Likewise. PR c++/15967 * g++.dg/lookup/crash3.C: New test. From-SVN: r83158
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/search.c10
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7148f22..1fc8ec0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+ PR c++/15967
+ * search.c (lookup_field): Propagate the ambiguity list.
+ (lookup_fnfields): Likewise.
+
+2004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
PR c++/15947
* parser.c (cp_parser_template_name): Ctors/dtors never need a
template keyword to disambiguate.
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 5f4c91c..ca86b13 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1332,8 +1332,9 @@ lookup_field (tree xbasetype, tree name, int protect, bool want_type)
{
tree rval = lookup_member (xbasetype, name, protect, want_type);
- /* Ignore functions. */
- if (rval && BASELINK_P (rval))
+ /* Ignore functions, but propagate the ambiguity list. */
+ if (!error_operand_p (rval)
+ && (rval && BASELINK_P (rval)))
return NULL_TREE;
return rval;
@@ -1347,8 +1348,9 @@ lookup_fnfields (tree xbasetype, tree name, int protect)
{
tree rval = lookup_member (xbasetype, name, protect, /*want_type=*/false);
- /* Ignore non-functions. */
- if (rval && !BASELINK_P (rval))
+ /* Ignore non-functions, but propagate the ambiguity list. */
+ if (!error_operand_p (rval)
+ && (rval && !BASELINK_P (rval)))
return NULL_TREE;
return rval;