On Jan 28, 2009, at 5:31 PM, Eli Friedman wrote:
> On Wed, Jan 28, 2009 at 3:36 PM, Douglas Gregor <[email protected]>
> wrote:
>> + // When we're coping with C99 designated initializers into a
>> + // union, find the field that has the same type as the
>> expression
>> + // we're initializing the union with.
>> + if (isUnion && CurInitVal < NumInitElements &&
>> + (CGF.getContext().getCanonicalType(Field->getType()) !=
>> + CGF.getContext().getCanonicalType(E-
>> >getInit(CurInitVal)->getType())))
>> + continue;
>
> This is kind of messy.
Yes, it is messy... I've decided to annotate InitListExprs for unions
with the FieldDecl that should be initialized. Semantic analysis fills
in this value, and CodeGen can blindly follow it.
- Doug
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits