Explicit instantiation/specialization of inheriting constructor templates
_N4527_.12.9 [class.inhctor]
Daveed Vandevoorde

Created on 2013-08-16.00:00:00 last changed 81 months ago


Date: 2014-02-15.00:00:00

[Moved to DR at the February, 2014 meeting.]

Date: 2014-01-15.00:00:00

Proposed resolution (January, 2014):

Change _N4527_.12.9 [class.inhctor] paragraph 4 as follows:

A constructor so declared has the same access as the corresponding constructor in X. It is deleted if the corresponding constructor in X is deleted (9.5 [dcl.fct.def]). An inheriting constructor shall not be explicitly instantiated (13.9.3 [temp.explicit]) or explicitly specialized (13.9.4 [temp.expl.spec]).
Date: 2016-02-15.00:00:00

It is not clear whether it is permitted to explicitly instantiate or explicitly specialize specializations of inheriting constructor templates. Since inheriting constructors are considered to be implicitly declared (_N4527_.12.9 [class.inhctor] paragraph 1), it might be inferred that 13.9.3 [temp.explicit] paragraph 4 forbids their explicit instantiation:

If the declaration of the explicit instantiation names an implicitly-declared special member function (Clause 11.4.4 [special]), the program is ill-formed.

Similarly, an explicit specialization provides a definition for the specialized member, and 11.4.4 [special] paragraph 1 forbids defining an implicitly-declared special member function.

These inferences do not seem conclusive, however, so an explicit statement in _N4527_.12.9 [class.inhctor] would be helpful.

(See also issue 1780.)

Date User Action Args
2014-11-24 00:00:00adminsetstatus: dr -> c++14
2014-03-03 00:00:00adminsetmessages: + msg4961
2014-03-03 00:00:00adminsetstatus: tentatively ready -> dr
2014-01-20 00:00:00adminsetmessages: + msg4736
2014-01-20 00:00:00adminsetstatus: drafting -> tentatively ready
2013-10-14 00:00:00adminsetstatus: open -> drafting
2013-08-16 00:00:00admincreate