This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ambiguity in operator delete


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]