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++/27141] New: Unexpected requirement for usual deallocation function


This code:

  struct D {
      D() {}
      virtual ~D() {}
      void operator delete(void*, void*) {}
  };
  void f() { D d(); }

is rejected with "no suitable 'operator delete' for 'D'".
It is true that the placement deallocation function hides any
"usual" one, but surely it is only necessary for a usual one to
be found when implementing a delete-expression, as described
in 12.5#4.  This code is accepted by Comeau and HP aC++ (but
faulted by Sun C++ with a similar error to g++).


-- 
           Summary: Unexpected requirement for usual deallocation function
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: algrant at acm dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27141


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