Title
Wording issues regarding decltype(auto)
Status
cd4
Section
9.2.9.3 [dcl.type.simple]
Submitter
Daveed Vandevoorde

Created on 2014-02-04.00:00:00 last changed 87 months ago

Messages

Date: 2014-11-15.00:00:00

[Moved to DR at the November, 2014 meeting.]

Date: 2014-02-15.00:00:00

Proposed resolution (February, 2014):

  1. Change 9.2.9.3 [dcl.type.simple] paragraph 2 as follows:

  2. The simple-type-specifier auto specifier is a placeholder for a type to be deduced (9.2.9.7 [dcl.spec.auto]). The other simple-type-specifiers...
  3. Change 9.2.9.7 [dcl.spec.auto] paragraph 1 as follows:

  4. The auto and decltype(auto) type-specifiers are used to designate a placeholder type that will be replaced later, either by deduction from an initializer or 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.

Date: 2014-02-04.00:00:00

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:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: + msg5362
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-03-03 00:00:00adminsetmessages: + msg4823
2014-02-04 00:00:00admincreate