Created on2014-06-30.00:00:00 last changed109 months ago
[Moved to DR at the May, 2015 meeting.]
Proposed resolution (April, 2015):
Change 9.2.9.7 [dcl.spec.auto] paragraph 7 as follows:
...If the placeholder isthedecltype(auto)type-specifier, the declaredtype of the variable or return type of the function shall be theplaceholder alone. The type deduced for the variable or returntype is determined as described in 9.2.9.3 [dcl.type.simple],as thoughtheinitializerinitializer-clauseorexpression-list of theinitializer ortheexpression of thereturn statement hadbeen the operand of the decltype. [Example:int i; int&& f(); auto x2a(i); //decltype(x2a) isint decltype(auto) x2d(i); //decltype(x2d) isint auto x3a = i; //decltype(x3a) isint decltype(auto) x3d = i; //decltype(x3d) isint ...
According to 9.2.9.7 [dcl.spec.auto] paragraph 7,
If the placeholder is thedecltype(auto)type-specifier, the declared type ofthe variable or return type of the function shall be theplaceholder alone. The type deduced for the variable orreturn type is determined as described in9.2.9.3 [dcl.type.simple], as though the initializer hadbeen the operand of thedecltype.
This is problematic when the parenthesized form ofinitializeris used, e.g.,
int i; decltype(auto) x(i);
the specification would deduce the type asdecltype((i)),orint&. The wording should be clarified that theexpression and not the entireinitializer is consideredto be the operand ofdecltype.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
| 2015-11-10 00:00:00 | admin | set | status: dr -> drwp |
| 2015-05-25 00:00:00 | admin | set | messages: +msg6051 |
| 2015-05-25 00:00:00 | admin | set | status: tentatively ready -> dr |
| 2015-04-13 00:00:00 | admin | set | messages: +msg5313 |
| 2015-04-13 00:00:00 | admin | set | status: drafting -> tentatively ready |
| 2014-06-30 00:00:00 | admin | create | |