Title
Non-deleted explicit specialization of deleted function template
Status
drafting
Section
13.9.4 [temp.expl.spec]
Submitter
Richard Smith

Created on 2014-01-19.00:00:00 last changed 125 months ago

Messages

Date: 2014-01-19.00:00:00

The resolution of issue 941 permits a non-deleted explicit specialization of a deleted function template. For example:

  template<typename T> void f() = delete;
  decltype(f<int>()) *p;
  template<> void f<int>();

However, the existing normative wording is not adequate to handle this usage. For one thing, =delete is formally, at least, a function definition, and an implementation is not permitted to instantiate a function definition unless it is used; presumably, then, an implementation could not reject the decltype above as a reference to a deleted specialization. Furthermore, there should be a requirement that a non-deleted explicit specialization of a deleted function template must precede any reference to that specialization. (I.e., the example should be ill-formed as written but well-formed if the last two lines were interchanged.)

History
Date User Action Args
2014-01-19 00:00:00admincreate