Title
Missing handling of operator new[] for deallocation function template matching
Status
tentatively ready
Section
13.10.3.7 [temp.deduct.decl]
Submitter
Jiang An

Created on 2026-01-26.00:00:00 last changed 2 weeks ago

Messages

Date: 2026-02-20.22:26:13

Proposed resolution (approved by CWG 2026-02-20):

  1. Change in 13.10.3.7 [temp.deduct.decl] paragraph 1 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 allocation function (6.8.6.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 allocation function as described in 7.6.2.8 [expr.new]. The deduction is done as described in 13.10.3.6 [temp.deduct.type].
  2. Change in 13.7.7.3 [temp.func.order] bullet 1.3 as follows:

    • ...
    • when a placement operator delete deallocation function that is a function template specialization is selected to match a placement operator new allocation function (6.8.6.5.3 [basic.stc.dynamic.deallocation], 7.6.2.8 [expr.new]);
    • ...
Date: 2026-01-26.00:00:00

(From submission #838.)

Subclause 13.10.3.7 [temp.deduct.decl] paragraph 1 does not handle array-new.

History
Date User Action Args
2026-02-20 22:26:13adminsetstatus: open -> tentatively ready
2026-02-19 23:14:59adminsetmessages: + msg8480
2026-01-26 00:00:00admincreate