This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 113d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-05


1178. Deduction failure matching placement new

Section: 13.10.3.7  [temp.deduct.decl]     Status: C++11     Submitter: Mike Miller     Date: 2010-08-19

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

The new wording added by issue 873 says,

...This is also done to determine whether a function template specialization matches a placement operator new (6.7.5.5.3 [basic.stc.dynamic.deallocation], 7.6.2.8 [expr.new])... 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 [temp.func.order]), deduction fails and the declaration is ill-formed.

The statement describing the consequence of deduction failure (“the declaration is ill-formed”) does not apply to the case when deduction is being performed for placement operator delete, 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.

Proposed resolution (November, 2010) [SUPERSEDED]:

Change 13.10.3.7 [temp.deduct.decl] paragraphs 1-2 as follows:

In a declaration whose declarator-id 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 [temp.explicit]), explicit specializations (13.9.4 [temp.expl.spec]), and certain friend declarations (13.7.5 [temp.friend]). This is also done to determine whether a deallocation function template specialization matches a placement operator new (6.7.5.5.3 [basic.stc.dynamic.deallocation], 7.6.2.8 [expr.new]). In all these cases, P is the type of the function template being considered as a potential match and A is either the function type from the declaration or the type of the deallocation function that would match the placement operator new as described in 7.6.2.8 [expr.new]. The deduction is done as described in 13.10.3.6 [temp.deduct.type].

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 [temp.func.order]), deduction fails and, in the declaration cases, the declaration program is ill-formed.