<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2280</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="2280"></A><H4>2280.
  
Matching a usual deallocation function with placement new
</H4>
<B>Section: </B>7.6.2.8&#160; [<A href="https://wg21.link/expr.new">expr.new</A>]
 &#160;&#160;&#160;

 <B>Status: </B>C++20
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2016-06-27<BR>


<P>[Accepted as a DR at the November, 2019 meeting.]</P>



<P>The restrictions in 7.6.2.8 [<A href="https://wg21.link/expr.new">expr.new</A>] against
a placement deallocation function signature matching a usual
deallocation function signature consider only <TT>std::size_t</TT>
parameters, omitting <TT>std::align_val_t</TT> parameters.</P>

<P><B>Proposed resolution (February, 2017):</B></P>

<P>Change 7.6.2.8 [<A href="https://wg21.link/expr.new#27">expr.new</A>] paragraph 27 as follows:</P>

<BLOCKQUOTE>

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 (9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>]), all
parameter types except the first are identical. 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 a
usual deallocation function <DEL>with a parameter of
type <TT>std::size_t</TT> (6.8.6.5.3 [<A href="https://wg21.link/basic.stc.dynamic.deallocation">basic.stc.dynamic.deallocation</A>])</DEL> 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. For a non-placement allocation function, the normal
deallocation function lookup is used to find the matching deallocation
function (7.6.2.9 [<A href="https://wg21.link/expr.delete">expr.delete</A>])<INS>.</INS> [<I>Example:</I>...

</BLOCKQUOTE>&gt;

<BR><BR>
</BODY>
</HTML>
