------- Comment #2 from jason at gcc dot gnu dot org  2009-11-20 03:05 -------
I just had another email exchange about this, but can't find it right now. 
Anyway, 5.3.4 [expr.new]:

A declaration of a placement deallocation function matches the declaration of a
placement allocation function if it has the same number of parameters and,
after parameter transformations (8.3.5), all parameter types except the first
are identical. Any non-placement deallocation function matches a non-placement
allocation function. If the lookup finds a single matching deallocation
function, that function will be called; otherwise, no deallocation function
will be called. If the lookup finds the two-parameter form of a usual
deallocation function (3.7.4.2) and that function, considered as a placement
deallocation function, would have been selected as a match for the allocation
function, the program is ill-formed. [ Example:
      struct S {
         // Placement allocation function:
         static void* operator new(std::size_t, std::size_t);
         // Usual (non-placement) deallocation function:
         static void operator delete(void*, std::size_t);
      };
// ill-formed: non-placement deallocation function matches
// placement allocation function
      S* p = new (0) S;       
    — end example ]


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-11-20 03:06:00
               date|                            |


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

Reply via email to