<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68489>68489</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`enum-constexpr-conversion` inconsistently raised in variadic/non-variadic NTTP contexts
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Tsche
</td>
</tr>
</table>
<pre>
Hey,
Clang 16 introduced a potentially breaking change affecting enums with no underlying type explicitly specified ([Discourse](https://discourse.llvm.org/t/clang-16-notice-of-potentially-breaking-changes/65562)). Unfortunately this is not SFINAE friendly yet (https://github.com/llvm/llvm-project/issues/57176).
During reserach I've seen various enum "reflection" libraries sidestep this new diagnostic by converting from floats (https://github.com/llvm/llvm-project/issues/58127#issuecomment-1673662280) or by using `__builtin_bit_cast` or, well `std::bit_cast` (for example see [magic_enum](https://github.com/Neargye/magic_enum/blob/master/include/magic_enum.hpp#L623-L628)).
I noticed clang behaves inconsistently depending on whether a result of a conversion like that is used in a pack or not. https://godbolt.org/z/T6T8ohqvv here's a code example.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyklN-OqzYQxp_GuRkRwRD-XXCxZ1PUlY5WlZpeR8YewF3HprbJLn36yiTbk3Paq1aKHGEPzDe_-cbcezUaopYVX1hx3PElTNa1Jy8m2vVWru3PtDJ8ZumRpU-39VlzM0JWgjLBWbkIksBhtoFMUFzrFXpH_E2ZEcTEzUjAh4FEiBtklouHdxUmMBYWI8npNR6EdSagj1kroYJewc8k1KBIAsOaFV-Oygu7OE-sODKspxBmz_Inhh3DTn4e7rW-XvbWjQy7wLATUWqSlYmxQQlK7JA86Ew-dSY3nZ5hVxZFiQwbhs0efjODdWExPJBeIUzKg_JgbIBfu5fXp59gcIqM1CusFOAfskYVpqXfC3th2EVl979kdvZ3ElGg8n7Z8hZVVpVb0kfUx8VFOI48OS4meGFYXQk8kYErd8oufkMKDNHRoCNlaxgiaNU77hR58EqSDzTf9Bt6B6n4aKwPSkC_grDmSm7rzuDsBQZtefD_s5o6w4phvm0Ie7mQCUlWVnlZItYpwwasi8kXH_OyMj2f-0XpoMy5V-EsuA-sTME6hs_wTlrHGB9kVJM_PYYwrAfrgD74ZdYbGmDFlwsflThHNP_ml-9KeSXuxpUYdg8vYddr2297PpCLtRmhF_l92H6aZ4b51xLz5GuJ9d03jx28rS9wM6CEzZHQ08Sv5EEZYY1XPlpSryBpJiMjEWvgfaIwkQMe27_oAHYAfu-WV9aAVm8EYeIhmnLxJEGZOIhcvEW6xoY9_FC3lb3V4T4gfzLsTuWpttMf1ytM5Ihh5bcckj6B7neyzWWTN3xHbVY2ZfwdcDe1TY2cUDQcqywteVplqWyqqhgOQhRy6HeqxRTzLE2rrMwrxD0vilT2meTYp3VWV-yQ0oUr_ffU7ja_tGV9qJud5j1pv11MiNG22yFDjPeUazfr9cvo2SHVygf_7StBBU0tK9PYoyQSDvQxu-Qbu2icH9g7ru4I42BxqQTDzliTfD7C6-n0S-Qf6CP43eJ0-98HZCvxrwAAAP__wrHTHA">