diff options
author | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-06-15 01:46:21 +0000 |
---|---|---|
committer | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-06-15 01:46:21 +0000 |
commit | c566721f93bb378064b5101a9d5156ce6018159b (patch) | |
tree | 91d0c8dd9e53f1a3ff47738322bdf184f3022066 /gcc/cp/search.c | |
parent | 4e0f4df508db6bccfdca88a2bcf26e03317d4c71 (diff) | |
download | gcc-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/search.c')
-rw-r--r-- | gcc/cp/search.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; |