This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47453] Various non-conforming behaviors with braced-init-list initialization
- From: "schaub.johannes at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 May 2011 05:35:35 +0000
- Subject: [Bug c++/47453] Various non-conforming behaviors with braced-init-list initialization
- Auto-submitted: auto-generated
- References: <bug-47453-4@http.gcc.gnu.org/bugzilla/>
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});