[Bug c++/11339] New: cannot instantiate class derived from base with public virtual destructor and private operator delete
pbrannan at atdesk dot com
gcc-bugzilla@gcc.gnu.org
Thu Jun 26 21:29:00 GMT 2003
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++
More information about the Gcc-bugs
mailing list