<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99278>99278</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang][C++26] Clang overly generalizes the change in P3144R2 to pointers to incomplete enumration types
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
frederick-vs-ja
</td>
</tr>
</table>
<pre>
Despite the title being "Deleting a Pointer to an Incomplete Type Should be Ill-formed", [P3144R2](https://wg21.link/p3144r2) only made deleting pointers to incomplete class types.
So, currently the following definition is supposed to be well-formed. But Clang currently reject it ([Godbolt link](https://godbolt.org/z/aMPasEfad)).
```C++
enum E {
zero = decltype(delete static_cast<E*>(nullptr), 0){} // E is incomplete here
};
```
Not sure whether the standard or Clang should be fixed. As it's already very tricky to attempt to delete a pointer to an incomplete enumeration type, a CWG issue might be wanted to reject such delete-expressions.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0k0GPozgQhX9NcSklggICHDh0Qmc0h121dlba48rgCnjGsZFtuif961cm9Ew02pFQIImpeu-rV8J7NRrmFsojlF0iljBZ114cS3Zq-LZ79buvIumtvLUd-1kFxjAxBhU0Y8_KjAhEHWsO8Vngi1UmsMNgURj8bAZ7nTUHxr9vM-OXyS5aYs_4WevdxborSyACOiGUx5c8K4q_CMoOqJ5CmD3kT0BnoPPbSNleK_MN6DzHY46AGrRG3_AqJKP8kDDfBfioQP1sP2jhPYbbzH4PaQfp0_3zi43Nh8U5NkHfVncXq7V9i8UkX5RRQVmDyqNf5tl6lrF0z_jGPzzs8bgEPGlhxodajr_yEFAFBKqhPH6ysrc64Orjf0yO9__31o1A53egs_jjRfjni5BADVDzofyQ3q8T0DFe669slis-I1Tbd3xnZxHyDiUPOjoHqldMjD6IoIZ_B-ED5KdnoCfIn4Fqs2g9B7d2O2Ea79URqg7vAvE5YnigOrHjTVPVQX78Rd8j6D9tQL84xreJwxQTMq06jBROonUbPf8jIRf1PYJ98qgCUOVRaMdC3vCV3Q1DjOdtjVkIfJ1DfNzciY8QbCl8EBwhsRPrRO9ITijw9M8nVN4vjFc1TmEdrjDhPultin4Zpq3Bjr_Pjr1X1vh9IttcNnkjEm6zirKsqeuckqktmgOVlDe9pKI_5LJMm8uhKes0476XWZGollIq0iqr0kNRZbQv6_7S5JUoKRuoqAUUKV-F0nutX68xFckqsm0aqupEi561XzeXaIjw4iaVXeLaeH7XL6OHItXKB_-zwrq58aUVd0xhedxiRAcou20M9pWdvuHIhp3Q6p39Oq9hEmZkVAa3XY2AfrNxEfUDaZ8sTre_BF6Faen3g70CnaPE7babnY3Qgc6rYw90vpt-bem_AAAA__82Q4Sm">