This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
ambiguity in operator delete
- To: gcc-bugs at gcc dot gnu dot org
- Subject: ambiguity in operator delete
- From: Alexander Zvyagin <zvyagin at gams dot ihep dot su>
- Date: Sun, 17 Oct 1999 09:14:04 +0400 (MSD)
Dear GCC developers,
I have problem with this simple code (under gcc-2.95.1) file b.c:
class A { public: void operator delete (void *ptr); };
class N: public A {};
class C1: virtual public A { public: ~C1(); };
class C2: public C1, virtual public N { public: ~C2(); };
C2::~C2(){}
$ g++ -c b.c
b.c: In method `C2::~C2()':
b.c:5: request for member `operator delete' is ambiguous
b.c:1: candidates are: static void A::operator delete(void *)
b.c:1: static void A::operator delete(void *)
Even if my code contains some ambiguity (I do not understand why, I
belive that objects derived from class A must be deleted via A::operator
delete) GCC prints IDENTICAL operators that caused the ambiguity!
With best wishes,
Alexander Zvyagin.