Title
Overload resolution involving aggregate initialization
Status
c++11
Section
12.2.4.3 [over.ics.rank]
Submitter
Jason Merrill

Created on 2010-06-15.00:00:00 last changed 130 months ago

Messages

Date: 2011-03-15.00:00:00

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

Date: 2010-08-15.00:00:00

Proposed resolution (August, 2010) [SUPERSEDED]:

Change 12.2.4.3 [over.ics.rank] bullet 3.2 as follows:

  • User-defined conversion sequence U1 is a better conversion sequence than another user-defined conversion sequence U2 if they contain the same user-defined conversion function or constructor or aggregate initialization and if the second standard conversion sequence of U1 is better than the second standard conversion sequence of U2.

Date: 2010-06-15.00:00:00

The current wording makes some calls involving aggregate initialization ambiguous that should not be. For example, the calls below to f and g should each prefer the second overload:

    struct A { int i; };

    void f (const A &);
    void f (A &&);

    void g (A, double);
    void g (A, int);

    int main() {
       f ( { 1 } );
       g ( { 1 }, 1 );
    }
History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3375
2011-04-10 00:00:00adminsetstatus: review -> fdis
2010-08-23 00:00:00adminsetmessages: + msg2833
2010-06-15 00:00:00admincreate