This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [c++] RFC: partial C99 designated-initializers support


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]