Title
List-initialization and overloaded function disambiguation
Status
cd3
Section
12.3 [over.over]
Submitter
Daniel Krügler

Created on 2012-10-08.00:00:00 last changed 90 months ago

Messages

Date: 2013-04-15.00:00:00

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

Date: 2013-02-15.00:00:00

Proposed resolution (February, 2013):

Change 12.3 [over.over] paragraph 1 as follows:

...The target can be

  • an object or reference being initialized (9.4 [dcl.init], 9.4.4 [dcl.init.ref], 9.4.5 [dcl.init.list]),

  • ...

Date: 2012-10-08.00:00:00

Presumably, 12.3 [over.over] paragraph 1,

A use of an overloaded function name without arguments is resolved in certain contexts to a function, a pointer to function or a pointer to member function for a specific function from the overload set. A function template name is considered to name a set of overloaded functions in such contexts. The function selected is the one whose type is identical to the function type of the target type required in the context. [Note: That is, the class of which the function is a member is ignored when matching a pointer-to-member-function type. —end note] The target can be

  • an object or reference being initialized (9.4 [dcl.init], 9.4.4 [dcl.init.ref]),

  • ...

should apply to an example like

  double bar(double) { return 0.0; }
  float bar(float) { return 0.0f; }

  using fun = double(double);
  fun &foo{bar};

However, there is implementation variance in whether the use of bar is accepted or not, and the omission of a cross-reference to 9.4.5 [dcl.init.list] might be read as indicating that list-initialization is not included.

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: + msg4421
2013-05-03 00:00:00adminsetstatus: tentatively ready -> dr
2013-03-18 00:00:00adminsetmessages: + msg4250
2013-03-18 00:00:00adminsetstatus: drafting -> tentatively ready
2012-10-08 00:00:00admincreate