This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++: non-trivial labeled initializers
- To: anorland at hem2 dot passagen dot se
- Subject: Re: C++: non-trivial labeled initializers
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 5 Dec 1998 10:24:09 +0100
- CC: egcs at cygnus dot com
- References: <36686EA6.105A024F@hem2.passagen.se>
> What is causing this and what is a 'non-trivial labeled initializer'?
Please consider
struct A{
A(int);
};
struct B{
A a;
A b;
};
B b1 = {a:4, b:5};
B b2 = {b:4, a:5};
Both b1 and b2 use labeled initializers. egcs considers b2 to be
non-trivial, as the fields don't come in declaration order.
Regards,
Martin