<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/109311>109311</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang should not warn about =delete("reason") in C++17 mode while claiming to support it
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dangelog
</td>
</tr>
</table>
<pre>
Clang 19 seems to define `__cpp_deleted_function` even in pre-C++26 modes. However using it results in a warning:
```
void f() = delete
#if __cpp_deleted_function >= 202403L
("reason")
#endif
;
```
```
<source>:3:6: warning: '= delete' with a message is a C++2c extension [-Wc++26-extensions]
3 | ("reason")
| ^~~~~~~~
1 warning generated.
Compiler returned: 0
```
https://godbolt.org/z/Esqh5aPfb
It sounds a bit strange to claim support for a given language feature (by setting the corresponding feature-define macro), but then warn if that feature is used? Would it be possible, in pre-C++26 modes, to support the syntax and warn but _not_ set the macro?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VE2PqzYU_TVmc5UIbCDDgsVMMlErddHdW0YGX8CVsal9nXnTRX97ZSDzRk_Th6Ik9v3wOeceLEPQo0VsWfXCqksmI03Ot0raEY0bs86p9_ZspB2haCAgzgHIgcJBWwRW57dbvyw3hQYJ1W2ItiftLKtzwDta0BYWj4cz4y-Mv_AaZqcwHOE394Z39BCDtiNoAo8hGgqpQMKb9FbbkYlnll9Y_viu8_2zLu9OKxgYf2K8ASYusIHYc7nQA3wNDph4Tfk852Uu_tgKYG3EPcrgLOOc8eajE1qlh30lXr4E8_WmOAcXfY_rgc-CieeaiedP9IDx0yfo_ARvmiaQMGMIckTQASQ81OsBvxPasHKoXg7f-oesh49AYNVlZwQAAtjp_L_UYH1Sxvanev13e7Zw8QAKI1r0klAdt8jZzYs26MEjRW9RJSr5L4SZiJaQxsmvjF9Hpzpn6Oj8yPj1H8avr-HvqZJ_Dt3not8JgotWJQk6TRDIJ1sm__VG6hlCXBbnCQbnQcKok-GSVWNSbkBJ0WMi371DQKLEhCaE3nmPYXFWpZ0977Bbepa9d0khfoYuUiqwqw6gB6BJ0kdjHSCGRP0K31w0Krm4Q1hcCLozmBp87f4UIfeBPkEK75bkd5BWbWelk2_W0S0BXzM2XOKaqVaoRjQyw7Y48fpUl09NmU0tb4q6xoaXIm-6YsilEn0tRSeqTilenzLdroZviqaoq7ISx74qRKnKEy_LgaunJ1bmOEttjsbc5zScTIcQsS3yRhRFZmSHJqwXBed90jl5qbpkvk0Fhy6OgZW50YHCjxakyeB-g4Rp1ck62ljKzkVKr-7D_j_bNAm4i1ecVvHgbdIGt_mv8_yho6YsetP-ZDVNU-yOvZsZvyZQ-89h8e4v7Inx60oyMH7ded5b_l8AAAD__7Y3j_4">