This is the mail archive of the
mailing list for the GCC project.
Re: Designated Initializers in C++
- From: Jakub Jelinek <jakub at redhat dot com>
- To: David Brown <david at westcontrol dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 16 Sep 2014 13:20:29 +0200
- Subject: Re: Designated Initializers in C++
- Authentication-results: sourceware.org; auth=none
- References: <54181B9B dot 7070507 at westcontrol dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Sep 16, 2014 at 01:14:35PM +0200, David Brown wrote:
> After a recent discussion about designated initializers in C++, I
> noticed that they are accepted by modern gcc (when gcc extensions are
> On <https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html>, the
> documentation specifically says "This extension is not implemented in
> GNU C++". That certainly used to be the case - as far as I have tested,
> it was implemented in gcc 4.6 or 4.7.
> Could someone with commit access to the documentation fix that sentence?
??? Designated initializers definitely are not implemented in G++,
what there is is just very limited parsing, but the C++ FE requires that
the designators are just useless annotations, you can't initialize even
a POD out of order with the designators, skip some field, initialize
something twice etc.