Closed
Description
DIS 14882:2014 NB comment JP 07:
In 7.1.6.4p7: In the sentence, “When a variable…type of its specifier”, we think specification for function return type deduction is unclear, because the term "initializer" is not directly related to return statement.
Proposed change
Change to: (e.g.)
the deduced return type is determined from the type of expression specified for the return statement.
Activity
zygoloid commentedon Aug 22, 2014
Per [dcl.init]p15, initialization is performed by a return statement. The notion of there being an initializer in this context is used in other parts of the standard (for instance, [dcl.init]p17). The proposed change is not correct, because the initializer may be a braced-init-list, which is not an expression.
Alternative proposed change:
jensmaurer commentedon Nov 13, 2016
This is now [dcl.type.auto.deduct] and seems to have been rewritten such that the questionable phrase is gone.