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

2023-01-15


1199. Deleted constexpr functions

Section: 9.2.6  [dcl.constexpr]     Status: C++11     Submitter: Daniel Krügler     Date: 2010-09-17

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

The current requirements for constexpr functions do not permit a deleted constexpr function because the definition does not consist of a compound-statement containing just a return statement. However, it could be useful to allow this form in a case where a single piece of code is used in multiple configurations, in some of which the function is constexpr and others deleted; having to update all declarations of the function to remove the constexpr specifier is unnecessarily onerous.

Proposed resolution (January, 2011):

  1. Change 9.2.6 [dcl.constexpr] paragraph 3 as follows:

  2. Change 9.2.6 [dcl.constexpr] paragraph 4 as follows:

  3. The definition of a constexpr constructor In the definition of a constexpr constructor, each of the parameter types shall be a literal type or a reference to a literal type. In addition, either its function-body shall be = delete or it shall satisfy the following constraints: