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]
Other format: [Raw text]

[Bug c++/11339] New: cannot instantiate class derived from base with public virtual destructor and private operator delete


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++


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