This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47453] Various non-conforming behaviors with braced-init-list initialization


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47453

--- Comment #3 from Johannes Schaub <schaub.johannes at googlemail dot com> 2011-05-12 05:23:15 UTC ---
I think we have the FDIS clear about these cases now. To update:

    // invalid
    struct A { int a[2]; A():a({1, 2}) { } };

    // invalid
    int a({0});

    // invalid
    int const &b({0});

    struct A { explicit A(int, int); A(int, long); };

    // invalid
    A c({1, 2});

    // valid (by copy constructor).
    A d({1, 2L});

    // valid
    A e{1, 2};

    struct B { 
      template<typename ...T>
      B(initializer_list<int>, T ...); 
    };

    // invalid (the first phase only considers init-list ctors)
    // (for the second phase, no constructor is viable)
    B f{1, 2, 3};

    // valid (T deduced to <>).
    B g({1, 2, 3});


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]