<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/83837>83837</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Warn about redundant `const` in `constexpr` declarations?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zmodem
</td>
</tr>
</table>
<pre>
Consider:
```
constexpr int* const p = ...;
```
The `const` is redundant because `constexpr` implies constness.
We have some code like this where it seems the author may have intended `p` to be a "constant pointer to a constexpr int", which doesn't really make sense.
Perhaps a warning explaining that `p` is already const because of the constexpr would be helpful both in removing the redundancy, and showing users that constexpr applies to the variable?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU01v6yoQ_TV4M6pFIY6ThRdto6zf4kldj2ESeMVgMThp3q-_st027b1XsvAHc-acOT4gsz9Hok40z6I5VDgVl3L3_5AsDVWf7K17SZG9pSz0k5AHIT_Xrfy4lleTIhd6HzP4WIR6guUDjCD0Aeq6Fvr5r7h1_dcRiK1cMGIrwTNkslO0GAv0ZHDie8HMshQNY_DEK1Mk5vp7y1cChxcCTgOBSZYg-DeC4jzD1VEm8AWYaGAojmAdHAa8rTAfC0VLdmYdZ7aSoCdAEEothLOyMc1led5D-M0BJdQLXJ03DmwijkK1BTJhCDcY8I2AKTL9kPwPZYcjA8IVc_TxDPQ-BvTLY3FYvsR4BgyZ0N4-fP70KJ2Wae5armkKdlbuKIynKUCfigMfIdOQLmtj-jLb3GbVGC2wS9d5d2LKvJLfm-K4Ol_Sgr5g9tgHEvpY2U7bvd5jRd1jK_dNs9VSVa7bGd2fTsrsmp01tGtbZVttpbYkd81WtZXvlFQbqeXmUW0aqeqT1biRqBSax77dG7GRNKAPdQiXoU75XHnmibqd3um2CthT4CXGSpmA8Sz0k_V4jomLNzz_kOZQ5W5GP_TTmcVGBs-F7_2KL4G6V8wRsE9T-ZbBH-GMf0TRkgmYsfgUeXZhyqFzpYw8Hxp1FOp49sVNfW3SINRxZvy4PYw5_UemCHVcxmGhjstEvwIAAP__KRUtfA">