<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64874>64874</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang fail to compiles where GCC succeed, Error: initializer element is not a compile-time constant
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          TechScribe-Deaf
      </td>
    </tr>
</table>

<pre>
    Hello, I came across this bug when I was working on optimizing my software to move from static initialization to compile time constants and I came across a bug that appears only in Clang, but not in GCC. GCC is able to compile the following code just fine and produced expected output and behavior:

```c
#include <stdio.h>

typedef struct { int field; } DataType;
const DataType val = (DataType){ .field = 1 };
const DataType array[1] = { val };

int main(int argc, const char* argv[argc])
{
 printf("%i\n", array[0].field);
        return 0;
}
```

I am unsure if this is on Clang-side of the compilation or if this is actually on LLVM-side of the compilation.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U02v4ygQ_DX40krk4K_44MMknuw-afa0o723cTtmFoMF7WQzv36F_T4yI70owkB3FUXThSHoqyVqRHESRZvgwqPzzXdS49_K6452LeGQdK5_NH-SMU7IM7yAwokAlXchAI86QLdc4T6ShRe4Y4C78_9qewVnwc2sJ_0zrqYHBDfwHT0BO5jcjWDwboLAyFqBtpo1Gv0TWTsbU5SbZm0IWE8EytnAaDkA2v43Ebgq4BEZcJ4JfQBnzQO0hbNBe42yu4XBOo57f5zP-ziADoCdoV_OGgkGZ4y7R83K9QQ_lsAwaEvrybN3_aKoB_pvJsXUg1t4XngNdjTiTTsvsi8ibUX6Npbp9leva5lpq8zSE4jsHLjXbj-K7Oszhh8z9TRAYL8oBlGdQNuog0wvshOIqoUWGb8_ZhLZaQOtRXrfhhsaEFkLQh7fU2UdqfYrzxo8RKrPGNB7fIjidBBFu1FVp432CbONUd2E2gp5jFP0VxXrvhGqEb2QX-LuTRSnNVi0UczGUL1Swey15UHIo5BSyEKL4mzX6fldSyqKdtMf8W8i4PXniRdvIf1QV7W_vcKz6hfACRYbFk-gh62ddWyfrXN2QfcEblj7YuuRrT2df05HxQsa84i4b9_--esz2D7pm6yvsxoTag5lLcu8KqssGZu0pLwrZVF28oDdscSuK-u-KqQ8HuqyzBPdyFRm6VEeDnWRZ9k-oyxH2ZV52cta1rXIU5pQm70xt2nv_DXRISzUlPmxyhODHZmwGl1KS3dYg7GyRZv4JmJ23XINIk-NDhw-WFizoWatBgyozZNbQnS9p9VLYVGKqI8P9dX71QIfliYPZGgiy7Fa0Yb4xrH7xd3J4k0zMs8hWkhehLxcNY9Lt1duEvISVb1-drN3P0ixkJf1LkHIy3rX_wMAAP__c76Jog">