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

Reply via email to