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


1079. Overload resolution involving aggregate initialization

Section: 12.2.4.3  [over.ics.rank]     Status: C++11     Submitter: Jason Merrill     Date: 2010-06-15

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

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 );
    }

Proposed resolution (August, 2010) [SUPERSEDED]:

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