Labeled initializer elements mishandled
Andreas Schwab
schwab@issan.informatik.uni-dortmund.de
Mon Dec 29 02:25:00 GMT 1997
The C++ compiler mishandles labeled elements in initializers, ie. it
effectively ignores the labels.
$ cat init.cc
struct X { int a, b; };
struct X f (int a, int b)
{
struct X y = { b: b, a: a };
return y;
}
int main ()
{
struct X x = f (42, 0);
if (x.a != 42 || x.b != 0)
abort ();
exit (0);
}
$ gcc init.cc
$ ./a.out
Aborted (core dumped)
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
schwab@gnu.org
More information about the Gcc
mailing list