<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1178</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="1178"></A><H4>1178.
  
Deduction failure matching placement new
</H4>
<B>Section: </B>13.10.3.7&#160; [<A href="https://wg21.link/temp.deduct.decl">temp.deduct.decl</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2010-08-19<BR>


<P>[Voted into the WP at the March, 2011 meeting as part of paper N3262.]</P>

<P>The new wording added by <A HREF="873.html">issue 873</A> says,</P>

<BLOCKQUOTE>

...This is also done to determine whether a function template
specialization matches a placement <TT>operator new</TT> (6.8.6.5.3 [<A href="https://wg21.link/basic.stc.dynamic.deallocation">basic.stc.dynamic.deallocation</A>], 7.6.2.8 [<A href="https://wg21.link/expr.new">expr.new</A>])... If, for the set of
function templates so considered, there is either no match or more
than one match after partial ordering has been considered
(13.7.7.3 [<A href="https://wg21.link/temp.func.order">temp.func.order</A>]), deduction fails and the declaration
is ill-formed.

</BLOCKQUOTE>

<P>The statement describing the consequence of deduction failure
(&#8220;the declaration is ill-formed&#8221;) does not apply to
the case when deduction is being performed for placement
<TT>operator delete</TT>, as there is no declaration involved.
It may not be necessary to describe what happens when deduction
fails in that case, but at least the wording should be tweaked to
limit the conclusion to declarative contexts.</P>

<P><B>Proposed resolution (November, 2010) [SUPERSEDED]:</B></P>

<P>Change 13.10.3.7 [<A href="https://wg21.link/temp.deduct.decl">temp.deduct.decl</A>] paragraphs 1-2 as follows:</P>

<BLOCKQUOTE>

<P>In a declaration whose <I>declarator-id</I> refers to a
specialization of a function template, template argument deduction is
performed to identify the specialization to which the declaration
refers. Specifically, this is done for explicit instantiations
(13.9.3 [<A href="https://wg21.link/temp.explicit">temp.explicit</A>]), explicit specializations (13.9.4 [<A href="https://wg21.link/temp.expl.spec">temp.expl.spec</A>]), and certain friend declarations (13.7.5 [<A href="https://wg21.link/temp.friend">temp.friend</A>]).  This is also done to determine whether a
<INS>deallocation</INS> function template specialization matches a
placement <TT>operator new</TT> (6.8.6.5.3 [<A href="https://wg21.link/basic.stc.dynamic.deallocation">basic.stc.dynamic.deallocation</A>],
7.6.2.8 [<A href="https://wg21.link/expr.new">expr.new</A>]).  In all these cases, <TT>P</TT> is the
type of the function template being considered as a potential match
and <TT>A</TT> is <INS>either</INS> the function type from the
declaration <INS>or the type of the deallocation function that would
match the placement <TT>operator new</TT> as described in 7.6.2.8 [<A href="https://wg21.link/expr.new">expr.new</A>]</INS>. The deduction is done as described in
13.10.3.6 [<A href="https://wg21.link/temp.deduct.type">temp.deduct.type</A>].</P>

<P>If, for the set of function templates so considered, there is
either no match or more than one match after partial ordering has been
considered (13.7.7.3 [<A href="https://wg21.link/temp.func.order">temp.func.order</A>]), deduction fails and<INS>,
in the declaration cases,</INS> the <DEL>declaration</DEL>
<INS>program</INS> is ill-formed.</P>

</BLOCKQUOTE>

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