<div dir="ltr">One more thing I didn't catch the first time: please add a test for something like the following:<div><br></div><div><div>typedef union {</div><div>  struct {</div><div>    int zero;</div><div>    int one;</div>
<div>    int two;</div><div>    int three;</div><div>  } a;</div><div>  int b[4];</div><div>} union_16644_t;</div><div><br></div><div>union_16644_t x[2] = { [0].a.one = 2, [1].a.zero = 3, [0].a.zero = 5 };</div><div><br></div>
<div>-Eli</div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 24, 2013 at 2:06 PM, Matthew Curtis <span dir="ltr"><<a href="mailto:mcurtis@codeaurora.org" target="_blank">mcurtis@codeaurora.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>New patch incorporating Eli's feedback.<br>
      <br>
      Thanks Eli!<span class=""><font color="#888888"><br>
      <br>
      Matthew Curtis</font></span><div><div class="h5"><br>
      <br>
      On 9/24/2013 2:07 PM, Eli Friedman wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">On Tue, Sep 24, 2013 at 8:04 AM, Matthew Curtis <span dir="ltr"><<a href="mailto:mcurtis@codeaurora.org" target="_blank">mcurtis@codeaurora.org</a>></span>
        wrote:<br>
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">We now emit warnings
              when doing so and code generation is consistent<br>
              with GCC. Note that the C99 spec is unclear as to the
              precise<br>
              behavior.<br>
              <br>
              See also ...<br>
              Bug:<br>
                <a href="http://llvm.org/bugs/show_bug.cgi?id=16644" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=16644</a>
              and<br>
              <br>
              cfe-dev discussion:<br>
              <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html</a><span><font color="#888888"><br>
                  <br>
                  <br>
                </font></span></blockquote>
            <br>
            +    FieldDecl *CFD =
            ArrayFillerOrUnionFieldInit.dyn_cast<FieldDecl *>();<br>
            +    assert((FD == 0 || CFD == 0 || CFD == FD)<br>
            +           && "Only one field of a union may be
            initiazed at a time!");<br>
            <br>
            This will cause an unused variable warning in release
            builds.  Also, spelling.<br>
            <br>
            diff --git a/test/Sema/designated-initializers.c
            b/test/Sema/designated-initializers.c<br>
            index 36fa559..be365a0 100644<br>
            --- a/test/Sema/designated-initializers.c<br>
            +++ b/test/Sema/designated-initializers.c<br>
            @@ -1,5 +1,8 @@<br>
             // RUN: %clang_cc1 -fsyntax-only -verify -triple
            x86_64-unknown-unknown %s<br>
            +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s
            -DCHECK_CODEGEN=1 \<br>
            +// RUN:   -S -emit-llvm -o - 2>&1 | FileCheck %s<br>
            <br>
            Please put a separate code generation test into
            test/CodeGen.  It's okay if you duplicate the test code.<br>
            <br>
          </div>
          <div class="gmail_quote">The approach looks fine.<br>
            <br>
          </div>
          <div class="gmail_quote">-Eli<br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
    </div></div><div class="im"><pre cols="72">-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation</pre>
  </div></div>

</blockquote></div><br></div></div></div></div>