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

2024-11-11


1684. Static constexpr member functions for non-literal classes

Section: 9.2.6  [dcl.constexpr]     Status: C++14     Submitter: Richard Smith     Date: 2013-05-15

[Applied to WP at the February, 2014 meeting.]

The current wording of 9.2.6 [dcl.constexpr] paragraph 8 is:

The constexpr specifier has no effect on the type of a constexpr function or a constexpr constructor. The class of which a constexpr function is a member shall be a literal type (6.8 [basic.types]).

The previous version of this wording made clear that the restriction on the class type applied only to non-static member functions; consequently, the new formulation has inadvertently banned static constexpr member functions of non-literal classes.

Proposed resolution (November, 2013):

Change 9.2.6 [dcl.constexpr] paragraph 8 as follows:

The constexpr specifier has no effect on the type of a constexpr function or a constexpr constructor. The class of which a constexpr function is a member shall be a literal type (6.8 [basic.types]). [Example:...