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]

Re: C++: non-trivial labeled initializers


> 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


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