This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [c++] RFC: partial C99 designated-initializers support
- From: kaih at khms dot westfalen dot de (Kai Henningsen)
- To: gcc at gcc dot gnu dot org
- Date: 25 Oct 2004 21:26:00 +0200
- Subject: Re: [c++] RFC: partial C99 designated-initializers support
- Comment: Unsolicited commercial mail will incur an US$100 handling fee per received mail.
- Organization: Organisation? Me?! Are you kidding?
- References: <200410222347.50044.bernie@develer.com> <jevfczmacy.fsf@sykes.suse.de> <Pine.LNX.4.61.0410251005330.11023@digraph.polyomino.org.uk> <Pine.LNX.4.61.0410251005330.11023@digraph.polyomino.org.uk> <417CD992.2070905@codesourcery.com>
nathan@codesourcery.com (Nathan Sidwell) wrote on 25.10.04 in <417CD992.2070905@codesourcery.com>:
> Joseph S. Myers wrote:
> > If anyone produces a specific proposal to include designated initializers
> > in C++0x then they'll need to deal with the destructor order issue.
> > Without such a proposal, perhaps they should be limited to POD types in
> > C++, though I don't know offhand if that suffices to avoid all problems
> > with the definition of their semantics in C++.
>
> C++ already has a sequence point issue with initializers like,
> int i = 0;
> int ary[4] = {i++, i++, i++, i++};
> I recall asking whether this is undefined or not. I _think_ the response
> was that it is undefined, (because of lack of sequence points), but
> I can't find any documentation to that effect now. I think it was in
> response to a bug report though.
Well, given how C and C++ usually work, and the sequence point thing, it
would certainly be surprising if it *wasn't* undefined.
If I had to write such a proposal, I would certainly want to make it
undefined. There's no good reason to have it defined, and no obviously
right way to define it.
MfG Kai