[Bug c++/47453] Various non-conforming behaviors with braced-init-list initialization
schaub.johannes at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Thu May 12 05:57:00 GMT 2011
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});
More information about the Gcc-bugs
mailing list