<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/154096>154096</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
struct A { int a; }; struct A { int a; }; is rejected by clang -std=c23
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pascal-cuoq
</td>
</tr>
</table>
<pre>
I have read https://github.com/llvm/llvm-project/issues/149965 but this seems like a different issue.
I understand that the program `struct A { int a; }; struct A { int a; };` is valid C23. GCC 15.2 accepts it with `-std=c23` and rejects it with `-std=c17`. It is rejected by Clang 20.1.0 with `-std=c23`:
```
<source>:5:8: error: redefinition of 'A'
5 | struct A { int a; };
| ^
<source>:3:8: note: previous definition is here
3 | struct A { int a; };
| ^
1 error generated.
Compiler returned: 1
```
CE link: https://gcc.godbolt.org/z/Ej7vzY4z5
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykU8turDoQ_Jpm0wryA_NYsCBk5iqfcJcGGnDiwXNtM1fJ1x95JlGOcqIsThBSW3K5q6tVpUMwy0bUgroH9ZDpPa7Ot2cdRm3vxt39lw1uemkfcdUXQk96wjXGcwDZgTiCOC4mrvuQj-4E4mjt5b3cnb17ojGCOJoQdgogjrxomlLhsEeMqwkYiE4BrXkm1DiZeSZPW8QrPgfWAesecd8m8iHqbcK46vSS8Ozd4vUJoWQh-n2M2CFU92i2iBrkPUL1kMp3l1AyNAEv2poJeyFz_KfvkatcoB5HOseAJuL_Jq6J5i7ECeTDKGR6l4bxlOR9CeIVlCzHxyTlDUcTDi_YW70tKFjOc_Z167TXq_B0vv2sA9kHt_uRQB5AdgpkV4PskLx3Ph08TTSbzUTjNnQzgqg6EBWwDhFRIVT997u4AfEKfPtAHf6klu_Um4uU6tnTxbg94G8DmIAreXprKn_Azm8ScaGNvI40JVf07nQ2ljx6irvfaEpz8M8rY11_QGu253T7ybLjmC9uGpyNufMLiOMriOPhqbq8_lu8qmxq5dTIRmfU8kopxVXZyGxthZy14jWpupFVw_nMy0KLuWa1GFgpisy0ggnFal5zzgslc1HXSs-CyYYRKSahYHTSxuYpIYk7u3q95apgTZlZPZAN1ywKMSavgBAplr69RmrYlwAFsybE8NEimmip_escfPbolRc_TJnt3rY_yPxN2qUVvwIAAP__NH5OTg">