+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
{
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;
{
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;
--- /dev/null
+// { dg-do compile }
+// Contributed by Wolfgang Wieser <wwieser at gmx dot de>
+// PR c++/15967: ICE with ambiguous operator new
+
+typedef unsigned int size_t;
+
+struct A { void *operator new(size_t s){} }; // { dg-error "operator new" }
+struct B { void *operator new(size_t s){} }; // { dg-error "operator new" }
+
+struct C : A,B {};
+
+int crash()
+{
+ C *c=new C(); // { dg-error "ambiguous" }
+}