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
[Voted into the WP at the March, 2011 meeting as part of paper N3268.]
The body of a constexpr function is required by 9.2.6 [dcl.constexpr] paragraph 3 to be of the form
However, there does not seem to be any good reason for prohibiting the alternate return syntax involving a braced-init-list. The restriction should be removed.
Proposed resolution (March, 2010):
Change 8.7.4 [stmt.return] paragraph 2 as follows:
A return statementwithout an expressionwith neither an expression nor a braced-init-list can be used only in functions that do not return a value...
Change 9.2.6 [dcl.constexpr] paragraph 3 bullets 4 and 5 as follows:
its function-body shall be a compound-statement of the form
where expression is a potential constant expression (5.19), or
where every assignment-expression that is an initializer-clause appearing directly or indirectly within the braced-init-list is a potential constant expression
every constructor call and implicit conversion
used in converting expression to the function return
type initializing the return value
(8.7.4 [stmt.return], 9.4 [dcl.init])
shall be one of those allowed in a constant expression
(7.7 [expr.const]).
Notes from the March, 2010 meeting:
The new wording added in 7.7 [expr.const] in support of reference parameters for constexpr functions should also be considered to see whether additional changes are needed.