This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11339] New: cannot instantiate class derived from base with public virtual destructor and private operator delete
- From: "pbrannan at atdesk dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jun 2003 21:29:29 -0000
- Subject: [Bug c++/11339] New: cannot instantiate class derived from base with public virtual destructor and private operator delete
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11339
Summary: cannot instantiate class derived from base with public
virtual destructor and private operator delete
Product: gcc
Version: 3.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pbrannan at atdesk dot com
CC: gcc-bugs at gcc dot gnu dot org
[pbrannan@zaphod tmp]$ cat test.cpp
class Foo
{
public:
virtual ~Foo() { }
private:
static void operator delete(void *) { }
};
class Bar
: public Foo
{
};
int main()
{
Bar b;
}
I can compile the above code on comeau, but not on g++. I'm not sure which
compiler is correct.
[pbrannan@zaphod tmp]$ g++ test.cpp
test.cpp: In destructor `virtual Bar::~Bar()':
test.cpp:7: `static void Foo::operator delete(void*)' is private
test.cpp:17: within this context
[pbrannan@zaphod tmp]$ como test.cpp
Comeau C/C++ 4.3.0.1 (Aug 15 2002 09:47:16) for RedHat_LINUX_INTEL_ELF
Copyright 1988-2002 Comeau Computing. All rights reserved.
MODE:non-strict warnings C++