This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55805] Empty brace-init-list causes warning "missing initializer for member" in C++11
- From: "dave.gittins at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Jun 2015 11:49:42 +0000
- Subject: [Bug c++/55805] Empty brace-init-list causes warning "missing initializer for member" in C++11
- Auto-submitted: auto-generated
- References: <bug-55805-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55805
--- Comment #9 from Gubbins <dave.gittins at gmail dot com> ---
(In reply to Jonathan Wakely from comment #8)
> (In reply to Gubbins from comment #5)
> > The warning is still produced with gcc 4.9.2 (surely that's supported?)
>
> The warning isn't given for 5.1 and trunk (not sure what I tested before).
>
> (In reply to Gubbins from comment #6)
> > It's clear that A is an aggregate type, but it is also a class type with a
> > default constructor. Doesn't the quoted section of the C++11 specification
> > therefore state that the object should be value-initialized?
>
> Nope.
>
> 8.5.4 says:
>
> â Otherwise, if T is an aggregate, aggregate initialization is performed
> (8.5.1).
> â Otherwise, if the initializer list has no elements and T is a class type
> with a default constructor, the object is value-initialized. The C++11
> wording was fixed by a defect report, see
> http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1301
Oh I see... sorry, I was working off the text from before the defect report.
> (In reply to Gubbins from comment #7)
> > Anyway, even if this is classified as aggregate initialization (which I
> > believe it is in C++14?), I believe the behaviour should be changed.
>
> It already has been for gcc-5.
I see, thanks. Will there be no more releases on the 4.9 branch?