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

    <tr>
        <th>Summary</th>
        <td>
            clang-format is confused by C++11 attributes with arguments in enum definition
        </td>
    </tr>

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

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

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

<pre>
    `clang-format` thinks this is the right way to format the following code:

```c++
enum [[clang::enum_extensibility(open)]] E{// A comment.
                                           A,
 // Comment 2.
 B};
```

The argument list in the attribute seems to be responsible; I would guess that it's incorrectly deciding that this is declaring a variable of enumeration type, rather than defining an enumeration. If the attribute doesn't have an argument, we get formatting like the following, which is what I'd like `clang-format` to produce for the above testcase:

```c++
enum [[clang::enum_extensibility_open]] E {
    // A comment.
    A,
    // Comment 2.
    B
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslM9u4zgMxp9GvhANZPlfcvChSTZA73svZIu2tZWlQKKTzTz9QErSpp1iMIcJhAggyM_kxx8kQ9CjRWxZtWXVPpMLTc63Py6jM06rrHPq0rKa90ba8WlwfpbEag40afsW4hVAxxvB63EiOMsLkINrZooPzhh31naE3ilkxTPje8bv_zW_np6JbTwpinaZIXW0TR-ORUWKvuL_hDboThtNFybW7oiWiQ2r9qzawz-s2TJxYOIAz9C7eUZLq6sm_PnvmYndregmtrtKgbiLbVmzZ8X2yxCPk_07IUg_LqnO6ECgbfJDEnndLYQQEOcQ3eoQPIaji4MZZMUWXuDsFqNgXDBEeyWBJiaaANr2znvsyVxAYa9VdDYl3JehsDfSx7CEk_RadgbBDRD9Qy9JOwt0OSITO_CSJvSx3oLCQdtUZh9zV_AyfGlcOQyWiYZgkieM-fdJo-YZYUS6IUBR0Og3_MxCypt0P8WGz7H7FyYadc38jjcHR-_U0kcNf22ncycEwkC9DH-Xq9dE1Q0piEy9I_Qbuh6w-Uj8hRwAuGPzHUKZagu1KTYywzZvcl6VfF2us6lFiarGSg55XsiqyGvOc1QNclmKStYi063gouRFXgmRl3y94mLYrHPZVWpQdV4LVnKcpTYrY07zyvkx0yEs2K6rsqkzIzs0Ib0DQnyyX4j4Mvg2lj11yxhYySPQ4UOINBlsH6viXntnhyWggu4Cu-se8vwDowBnTdM7OhHtxN0NxMhetnjTTkTHEFeVHB01TUu36t3MxCE2cLuejt79hz0xcUhjBSYOabKfAQAA__8Ew4Gh">