Title
Deducing cv-qualified auto
Status
cd3
Section
9.2.9.7 [dcl.spec.auto]
Submitter
Jens Maurer

Created on 2012-11-18.00:00:00 last changed 123 months ago

Messages

Date: 2013-04-15.00:00:00

Proposed resolution (April, 2013):

This issue is resolved by the wording changes in N3638, adopted at the April, 2013 (Bristol) meeting.

Date: 2012-11-18.00:00:00

In an example like

  const auto x = 3;

the intent, clearly, is to make const int the type of x. It is not clear, however, that the current wording accomplishes this. Because the deduction is based on that of function calls, and because top-level cv-qualifiers are ignored in such deduction, it appears that 9.2.9.7 [dcl.spec.auto] paragraph 6,

The type deduced for the variable d is then the deduced A determined using the rules of template argument deduction from a function call (13.10.3.2 [temp.deduct.call]), where P is a function template parameter type and the initializer for d is the corresponding argument.

incorrectly gives x the type int.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetmessages: + msg4401
2013-05-03 00:00:00adminsetstatus: open -> dr
2012-11-18 00:00:00admincreate