Title
“Deduced type” is unclear in auto type deduction
Status
cd2
Section
9.2.9.7 [dcl.spec.auto]
Submitter
Michael Wong

Created on 2009-10-19.00:00:00 last changed 178 months ago

Messages

Date: 2010-03-15.00:00:00

[Voted into WP at March, 2010 meeting.]

Date: 2009-10-15.00:00:00

Proposed resolution (October, 2009):

Change 9.2.9.7 [dcl.spec.auto] paragraph 6 as follows:

...The type deduced for the variable d is then the deduced type A determined using the rules of template argument deduction...
Date: 2009-10-19.00:00:00

9.2.9.7 [dcl.spec.auto] paragraph 6 says,

Once the type of a declarator-id has been determined according to 9.3.4 [dcl.meaning], the type of the declared variable using the declarator-id is determined from the type of its initializer using the rules for template argument deduction. Let T be the type that has been determined for a variable identifier d. Obtain P from T by replacing the occurrences of auto with either a new invented type template parameter U or, if the initializer is a braced-init-list (9.4.5 [dcl.init.list]), with std::initializer_list<U>. The type deduced for the variable d is then the deduced type 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.

The reference to “the deduced type” is unclear; it could be taken as referring either to the template parameter or to the function parameter type. 13.10.3.2 [temp.deduct.call] uses the term “deduced A,” and that usage should be repeated here.

History
Date User Action Args
2010-03-29 00:00:00adminsetmessages: + msg2690
2010-03-29 00:00:00adminsetstatus: ready -> cd2
2009-11-08 00:00:00adminsetmessages: + msg2353
2009-10-19 00:00:00admincreate