This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60417] [DR 1518] Bogus error on C++03 aggregate initialization
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 27 Mar 2014 19:48:38 +0000
- Subject: [Bug c++/60417] [DR 1518] Bogus error on C++03 aggregate initialization
- Auto-submitted: auto-generated
- References: <bug-60417-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60417
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Still a regression for aggregate-initialization of arrays:
struct A { explicit A(int = 0); };
int main()
{
A a[1] = { };
}
zzz.cc: In function âint main()â:
zzz.cc:5:14: error: converting to âAâ from initializer list would use explicit
constructor âA::A(int)â
A a[1] = { };
^
And similarly for array members that are list-initialized:
struct A { explicit A(int = 0); };
struct B { A a[1]; B() : a{} {} };
int main()
{
B b;
}
zz.cc: In constructor âB::B()â:
zz.cc:2:28: error: converting to âAâ from initializer list would use explicit
constructor âA::A(int)â
struct B { A a[1]; B() : a{} {} };
^