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

    <tr>
        <th>Summary</th>
        <td>
            clang allows direct list initialization of flexible array member with `{}`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          Rush10233
      </td>
    </tr>
</table>

<pre>
    The following code is accepted by clang, which contains an invalid non-static list initialization statement of flexible array member `a[]`:

```c++
struct S {
    int bb;
    int a[];
};

void f ()
{
    S s=S{0,{}};
    //rejected
 //S s=S{0,{0}};
}
```
This only happens when the initialization list of `a` is empty, otherwise the compiler correctly rejects it.

GCC rejects the code. While ICC performs similarly with clang(accepts the first statement but rejects the second one).

[https://godbolt.org/z/66a4qE63a](https://godbolt.org/z/66a4qE63a)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU82u8yYQfRq8Gd2I4P-FF03SVN32flLXGMbxVBhcwEnzPX2FnbS5aStVQoQcZsbDOWdkCHSxiB0rD6w8ZXKJo_PdL0sY91zkedY7fe--jQiDM8bdyF5AOY1AAaRSOEfU0N9BGWkvTBzhNpIaQTkbJdkA0gLZqzSkwTr7EaKMpMBQiECWIklD32UkZyFd4YQ2ghtgMPgH9QZBei_vMOHUowdWcbn1ySrO8h8YPzH-3Cu-LcXEIa0VDdEvKsInsPqBAACQjdD3LH-DnrWfOKtfzut-daRhACYaJtpn0EuVTwgsP32y-sCZOKar-vRaJcUwcWbi7PE3VBH1A9_Af6Tzt_x0_vra7e-3kQI4a-4wynlGG-A2ooU44jvLK_Nu2KiseJIRpznek3QujuhvFHBNVG6ayaAH5bxHFc0dtqYDUNy9svLT8fjX1ZapcQe_jmQQfj4eYUY_OD8FCDSRkd7c4UZxfHqm2Xy05Q7kQ3zxQr_EL7UDKmc1OItMtF-6YOVhjHEOyRcrmxene2fizvkLE-fvTJyrSha__1jlMqksmv8fLtpMd7lu81Zm2O1rwduircs2GzsuhlrqYi9xGATyvFW6R543VS72ZaGHjDrBRcHrfcHbvCzbndZNo0uhdN437dBoVnCcJJmdMdcpfT6jEBbs2qbhRWZkjyas4ynEgzGRJtV3Kf6jXy6BFTzpGv6uECka7NZwkGluA2hKKv7r6P3nwK0yJZdtTq54tnjTvfFGcVz6nXITE-fUwOPnY_Yu6cbEeX1PYOK8PenaiT8DAAD__xzCXfU">