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

    <tr>
        <th>Summary</th>
        <td>
            clang rejects valid initialization of array to string literal of the form `({"string"})` and `{{"string"}}`
        </td>
    </tr>

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

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

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

<pre>
    ```cpp
char awoo[] ({"awoo"});
static_assert(sizeof(awoo) == 5);
```
Clang outputs:
```none
<source>:1:6: error: array initializer must be an initializer list or string literal
    1 | char awoo[] ({"awoo"});
 |      ^
<source>:2:21: error: invalid application of 'sizeof' to an incomplete type 'char[]'
    2 | static_assert(sizeof(awoo) == 5);
 |                     ^~~~~~
```
Note that [[dcl.init.string] p1](https://eel.is/c++draft/dcl.init.string#1) puts no restriction on the type of initialization. The string literal may always be enclosed in braces. `{"awoo"}` should be usable as an initializer in:
- copy initialization `= {"awoo"}`
- direct initialization `({"awoo"})`
- direct list initialization `{{"awoo"}}`
- copy list initialization `= {{"awoo"}}`

Clang rejects all but copy initialization. To be fair, the latter two are ambiguous with aggregate initialization, and I'm unsure whether this is an ambiguity in the standard or resolved somehow. Anyhow, MSVC manages to compile all of the above.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVEGvqzYT_TVmM7oIDAGyYJHc3Ejf4uumT91WAwzgytjINonyFv3tlU3uyw0vrdSiREkcn_HxOWcGrRWDIqrZ7sh2pwgXN2pTfwhL6ooXihrd3WpWJOurnWeWnFhyaEc0gFetVxwwXrHyyDgPa5yz8sT4nmXHdbt16ET7O1pLxjFeWfGddM94tW7fA8tOLDvB7ivox6nrz3eJagC9uHlxlmWHzSalFd2XsnerF9MSyz5YdkhZdihYdgAyRhv_BY3BGwglnEApvpOBabEOGgJUT8tSWAfagHVGqAGkcG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