Date
2003-10-15.00:00:00
Message id
923

Content

Proposed Resolution (October 2003):

Add the following text at the end of 7.6.2.8 [expr.new] paragraph 19:

If the lookup finds the two-parameter form of a usual deallocation function (6.7.6.5.3 [basic.stc.dynamic.deallocation]), 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);
};

S* p = new (0) S; // ill-formed: non-placement deallocation function matches 
                  // placement allocation function 
--- end example]