<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/121334>121334</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang allows for multiple declarations introduced by `using enum`
</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 under `-std=c++20`:
```c++
struct S2 {
enum B {
A
};
using enum B ;
};
```
MSVC and GCC choose to reject it as there would be a name conflict:
```c++
<source>:5:16: error: 'using S2::B::A' conflicts with a previous declaration
5 | using enum B ;
| ^
<source>:3:5: note: previous declaration 'S2::B S2::A'
3 | A
| ^
```
While the `using enum B` statement here actually seems to be meaningless, I'm not quite sure whether this should be rejected or not.
https://godbolt.org/z/3e3aGxnWW
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U01v4zYQ_TWjyyAGNbSk9UEH2VkveuilKZozRY0sFpTo8iNp-usLSl53NwlKEBiTNPnem6enQjCXhbmF6gjVY6FSnJxvf0thKgVJWfRueGt_nxhHZ617NcsFtRsYTUClNV8jD9i_obZquWBaBvYItXgIcQD5qIGOQEcSUAuQHYh11mKbt1MQXYg-6YhPhNDkNSIvacbjfYnYrRWaR5DbVgqZy_f_rZv30zvEhvjr0x8nVMuA304n1JNzgTE69Pwn64gmogoYJ_aMry7ZAXtGhYuaGbVbRmt0_D_yIE_BJa8Z5FeQXQWyK2uQHbL3zucfQM3G9onyQ7I7bqUDau4QAV9NnFDh1fOLcSngwNoqr6Jxy60JFUJz-kw5riMfvhtQff1IUd5o4uIi5_oZZGZ953tnninf8OQdr_vA4Ab7sw3Pk7GcG52_kB9FQC0wRBV55iXiaoTSMSlr3zAwzyG71TPOrBazXCyHAHTCX4CaOWvAv5KJjCFlByfOVmKcTMAwffdz85oHdD7f2G2MphivIQujM9D54obe2bhz_gJ0_gfoLFmqb38vz8_F0MrhIA-q4LZsZFXVspSymFr9ZWx4bOqyZj0K0RyaUWoiQc0XrqtSFqYlQfuSpCipolLuxv2hlk3T77lk3fQMe8GzMnZn7cucsQsTQuK2pFLKfWFVzzas8SRaUwZEOam-zRce-nQJsBfWhBj-eyKaaLndQqlybgOOzuOcbDRXyz_6HNAs0bsh6S3JP3kDtSiSt-27Rpk4pX6n3Qx0zpi38nD1LrcZ6LxqCEDnm4yXlv4NAAD__w4oT1s">