Created on 2014-02-04.00:00:00 last changed 94 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (February, 2014):
Change 9.2.9.3 [dcl.type.simple] paragraph 2 as follows:
The simple-type-specifier autospecifieris a placeholder for a type to be deduced (9.2.9.7 [dcl.spec.auto]). The other simple-type-specifiers...
Change 9.2.9.7 [dcl.spec.auto] paragraph 1 as follows:
The auto and decltype(auto) type-specifiers are used to designate a placeholder type that will be replaced later
, eitherby deduction from an initializeror by explicit specification with a trailing-return-type. The auto type-specifier is also used to introduce a function type having a trailing-return-type or to signify that a lambda is a generic lambda.
According to 9.2.9.3 [dcl.type.simple] paragraph 2,
The auto specifier is a placeholder for a type to be deduced (9.2.9.7 [dcl.spec.auto]).
This is not true when auto appears in the decltype(auto) construct.
On a slightly related wording issue, 9.2.9.7 [dcl.spec.auto] paragraph 2 says,
The auto and decltype(auto) type-specifiers designate a placeholder type that will be replaced later, either by deduction from an initializer or by explicit specification with a trailing-return-type.
This could be read as implying that decltype(auto) can be used to introduce a function with a trailing-return-type, contradicting 9.3.4.6 [dcl.fct] paragraph 2, which requires that a function declarator with a trailing-return-type must have auto as the sole type specifier.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
2015-04-13 00:00:00 | admin | set | messages: + msg5362 |
2014-11-24 00:00:00 | admin | set | status: ready -> dr |
2014-03-03 00:00:00 | admin | set | messages: + msg4823 |
2014-02-04 00:00:00 | admin | create |