Jens Maurer
N3277=11-0047
2011-03-25

N3277: Core issues 1194/1195/1199: References and constexpr

This paper presents the changes necessary to resolve core issues 1194 "Constexpr references", 1195 "References to non-literal types in constexpr functions", and 1199 "Deleted constexpr functions".


Change in 3.9 basic.types paragraph 10:
A type is a literal type if it is:
Change in 5.19 expr.const paragraph 1:
Change in 7.1.5 dcl.constexpr paragraph 1:
The constexpr specifier shall be applied only to the definition of an object a variable, the declaration of a function or function template, or the declaration of a static data member of a literal type (3.9 basic.types). ...
Change in 7.1.5 dcl.constexpr paragraph 3:
Change in 7.1.5 dcl.constexpr paragraph 4:
In a definition of a constexpr constructor, each of the parameter types shall be a literal type. In addition, either its function-body shall be = delete or it The definition of a constexpr constructor shall satisfy the following constraints:
Change in 7.1.5 dcl.constexpr paragraph 8:
A constexpr specifier used in an object declaration declares the object as const. Such an object shall be initialized. If it is initialized by a constructor call, the constructor shall be a constexpr constructor and every argument to the constructor shall be a constant expression. Otherwise, or if a constexpr specifier is used in a reference declaration, every full-expression that appears in its initializer shall be a constant expression.