This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


1510. cv-qualified references via decltype

Section: 9.3.4.3  [dcl.ref]     Status: CD3     Submitter: Richard Smith     Date: 2012-06-14

[Moved to DR at the April, 2013 meeting.]

According to 9.3.4.3 [dcl.ref] paragraph 1,

Cv-qualified references are ill-formed except when the cv-qualifiers are introduced through the use of a typedef (9.2.4 [dcl.typedef]) or of a template type argument (13.4 [temp.arg]), in which case the cv-qualifiers are ignored.

There does not appear to be a good reason not to extend this to apply to apply to decltype, as well.

Proposed resolution (October, 2012):

Change 9.3.4.3 [dcl.ref] paragraph 1 as follows:

...Cv-qualified references are ill-formed except when the cv-qualifiers are introduced through the use of a typedef typedef-name (9.2.4 [dcl.typedef], 13.2 [temp.param]) or of a template type argument (13.4 [temp.arg]) decltype-specifier (9.2.9.3 [dcl.type.simple]), in which case the cv-qualifiers are ignored. [Example:...