<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/132561>132561</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] Check request: modernize-use-elifdef-and-elifndef
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
denzor200
</td>
</tr>
</table>
<pre>
C++23 suggests us `#elifdef` and `#elifndef` as a new way to write directives in a long conditional preprocessing block.
Needs a check that will find usages of `#elif` followed by `defined identifier`(or `!defined identifier`) and will suggest to change it to `#elifdef identifier`(or `#elifndef identifier`).
BEFORE:
```
#ifdef CPU
std::cout << "4: no1\n";
#elif defined GPU
std::cout << "4: no2\n";
#elif !defined RAM
std::cout << "4: yes\n";
#endif
```
AFTER:
```
#ifdef CPU
std::cout << "4: no1\n";
#elifdef GPU
std::cout << "4: no2\n";
#elifndef RAM
std::cout << "4: yes\n";
#endif
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0lNGO2joQhp_GuRmBnDEhcJGLwC7n6pxTrdoHcOxJcNfY1HYWsU9fObAt7XalldpKSCT2zP_P91uxjNEMjqhh1YZVd4Uc096HRpN79gE5Lzqvzw3j7ZbhhuEGBcRxGCimCGMEtuQMBVnTa-rZkoN0-mbRvaxGkODoBCd5huThFEwi0CaQSuaJIhgHEqx3AyjvtEnGO2nhGOgYvKIYjRugs149zhlv_yPSWVDtST1C2ssEJ2Mt9MZpGKMcKILvb8bII_TeWn8iDd0572jqjSMNRpNLpjcUpvKVD5e-8o2C9UQ42V1zyDxqL91AYKaXHzJ50-BbPq8cMiLj7eZ-9__DPRP5OW9cfrxlKC7K2w-fGG8BAGLSuU60yo8JmNgysQWGuGCiBedLVm0dQ2Ric-nP1vAC-M97ZfCXMjdRPbT_vkfpTPGVktOm_5mTt-3u4_3DX0sgK_we_HR8f5a60I3Qa7GWBTVlvcBlvRDrutg3grrVqhdU6nLNa1qIHnHR81XHK4mKdGEa5FhxgYi8FGU9r5a6XlG9FFirNVecLTgdpLFza58Ocx-GwsQ4UlMKrJZlYWVHNk73AKKy0g2zZPQ5D1zdFaHJXbNuHCJbcGtiit91kkl2ukFu2qo72E7fZ6AvI8WUMzh4TcGZZ5qNkWbXM5hJp2cvaRZjsM0-pWPMSeKO4W4waT92c-UPDHfZ8vo3Owb_mVRiuJs4IsPdFeWpwa8BAAD__xP1apk">