<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87069>87069</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] bugprone-casting-through-void - flags casts from const void* to void* to A*
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy,
false-positive
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
PiotrZSL
</td>
</tr>
</table>
<pre>
Should not detect code like this:
```
struct A {
int a;
};
A* test(const void* ptr) {
return static_cast<A*>(const_cast<void*>(ptr));
}
```
Simply when source is already void* and we just add/drop const.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsks-OmzAQxp9muIyIjG0CHDhkN-XUQ6XceqkMdsBbByN7nFXevoIk3VSqZA3mG_mnb_6oGO04G9NC-QblMVOJJh_aH9ZT-Hn6nvVe39rT5JPTOHtCbcgMhIPXBp39bZAmG0EcgB2BPeOePc72GymkgfCAUL3dFUS0M6EC8RCgOn7dt3gAfkAykYDXg58j4dVbvYoLBeDNKywYSmHGSIrs8GtQkUC8rwAQ357Pn_KDcs_cUet5NfK_Gu7xZC-Lu-HnZGaMPoXBoI2oXDBK3_4aVLPGT4MfKRIqrYF3OvgFNxu7TLdCN6JRmWmLqigqXrBaZFNb11LK8iwKrup9w86MFfUg93smS1WXRmS25YxLJnhTSCal2NWlLAXjrJJ1L4VWIJm5KOt2zl0vOx_GzMaYTFtXbN9kTvXGxW3MnA9OzWNOVt-Ac-DvwPlZuWjyxUdL9mpWuTxmoV1ZeZ_GCJI5Gyl-0cmS2_bmhVYesU_jEvxs8rXjdk1Mwadxytf-YI5np8aIazLiOfgL_jte8q_XdYpZCq6diJZtz3gHvBstTanfDf4CvFsNPT75EvyHGQh4t9UegXdb-X8CAAD__38F4Is">