Created on 2014-11-14.00:00:00 last changed 34 months ago
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...
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...
[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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-02-18 07:47:23 | admin | set | messages: + msg6709 |
2017-02-06 00:00:00 | admin | set | status: tentatively ready -> cd4 |
2015-11-10 00:00:00 | admin | set | messages: + msg5597 |
2015-11-10 00:00:00 | admin | set | status: drafting -> tentatively ready |
2014-11-14 00:00:00 | admin | create |