[cfe-commits] r63253 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.def lib/CodeGen/CGExprAgg.cpp lib/CodeGen/CGExprConstant.cpp lib/CodeGen/CodeGenTypes.cpp lib/Sema/Sema.h lib/Sema/SemaInit.cpp test/Sema/designated-initializers.c

Eli Friedman eli.friedman at gmail.com
Wed Jan 28 17:31:28 PST 2009


On Wed, Jan 28, 2009 at 3:36 PM, Douglas Gregor <dgregor at apple.com> 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.  Also, shouldn't this be using getUnqualifiedType()?

-Eli



More information about the cfe-commits mailing list