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
[Adopted at the February, 2016 meeting.]
The resolution of issue 1877 does not correctly handle decltype(auto) return types with void return expressions:
T f(); decltype(auto) g() { return f(); }
fails when T is void.
Suggested resolution:
Change 9.2.9.7 [dcl.spec.auto] paragraph 7 as follows:
...In the case of a return with no operand or with an operand of type void, the declared return type shall be auto or decltype(auto) and the deduced return type is void. Otherwise...
Proposed resolution (September, 2015):
Change 9.2.9.7 [dcl.spec.auto] paragraph 7 as follows:
When a variable declared using a placeholder type is initialized, or a return statement occurs in a function declared with a return type that contains a placeholder type, the deduced return type or variable type is determined from the type of its initializer. In the case of a return with no operand or with an operand of type void
,:
if the declared return type is decltype(auto), then the deduced return type is void;
otherwise, the declared return type shall be cv auto and the deduced return type is cv void.
Otherwise, let T be...