[Bug c++/12615] [3.3 Regression] initializer syntax for POD structs gives parse error

jsm at polyomino dot org dot uk gcc-bugzilla@gcc.gnu.org
Tue Oct 14 21:38:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12615



------- Additional Comments From jsm at polyomino dot org dot uk  2003-10-14 21:38 -------
Subject: Re:  [3.3 Regression] initializer syntax for PAD
 structs gives parse error

On Tue, 14 Oct 2003, gdr at integrable-solutions dot net wrote:

>   object vorg = (object) { one_o: 0, allocstamp: 0 };
> 
> while valid C99, is invalid C++.

There are two extensions to C++ in play here:

* Compound literals (documented as supported as an extension in C++).

* Designated initializers, documented as unimplemented in GNU C++.  This 
example in fact uses the obsolete GNU syntax rather than the standard C99 
one.  I'd like to deprecate that obsolete syntax properly - the obstacle 
to doing so is deployed glibc headers that use the obsolete syntax in 
macros on the basis that (some version of) G++ does in fact support 
designated initializers, but only with the old and not the C99 syntax!



More information about the Gcc-bugs mailing list