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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Incorrect rejection of empty declaration in union.
        </td>
    </tr>

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

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

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

<pre>
    Clang rejects the following with `-pedantic-errors` in C++ (https://godbolt.org/z/jbaPKMqhs):

```cpp
union X{;};
```
```
<source>:1:9: error: extra ';' inside a union [-Werror,-Wextra-semi]
    1 | union X{;};
      | ^
```

However, I do not see anything prohibiting empty declarations in unions in general. They are only prohibited in anonymous unions.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsUk2PnDgU_DWPy1MjY7ehOXDoj0E7Wq20h5VmrwYe4InbJraZSefXR6Zbk2gSZEFJ1KtXKpcKQU-WqAF5AnnJ1Bpn55svpO1oVso6N9yas1F2Qk-v1MeAcSYcnTHuXdsJ33WcEUq2W2hQNup-R947H6BkqC2egZ-AnxD4YY5xCSCOwFvg7eSGzpmYOz8Bb78Db1879e_f_3ydA_A60dh2SnY__bIAO65WO4v_Q3UCcYLqkt6_kD5jcQ5u9T2BeAJxLEAckzJuDjfwLXqFwKukwyvUNuiBUOF9D8jT7uVO5ufdy8beBbpqkBdgR0TEAqE6459t4fak_yCfPltjx7_cO71RksZnHBxaFzEQobK3OKdoF-9m3emYMF2XeMOBeqO8itrZkNLd9m5oIktemRz_m-mGyhM6a24fEjQkkrLO3q5uDY_BPBsaMdSiVhk1RSVLLuuK19nc1EoUQ9UXSo1KlWUh93tZs5HtD7w_VHuR6YYzLtmBV6yQkte5GFQp-lGMQ12osa9hz-iqtMmNebumW850CCs1hZRSHDKjOjJhax3nfeoXcJ4K6Js0sOvWKcCeGR1i-CkRdTRbVe8T8oLPtnfeUx8f9Uz34Mbf4_pIK89Wb5pPXdRxXru8d1fgbVr2-OwW75Io8HYzH4C3D_9vDf8RAAD__5_Z_8w">