<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64011>64011</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
cppcoreguidelines-avoid-const-or-ref-data-members - false positive
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
johngladp
</td>
</tr>
</table>
<pre>
With clang-tidy v16 the following false positive error is generated:
```
struct extended_OVERLAPPED_t
{
OVERLAPPED overlapped{};
packet_descriptor_IOCP_t* const outer;
extended_OVERLAPPED_t(
packet_descriptor_IOCP_t& outer_ )
: outer( &outer_ )
{
}
};
```
error G417914D0: member 'outer' of type 'packet_descriptor_IOCP_t *const' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members,-warnings-as-errors]
The pointer "outer" is not const therefore this error is incorrect. In this instance the value pointed to by outer is const which is not a violation of the uncopyable/immovable C++ core guideline (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-constref) this rule is enforcing.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2PpDYQ_TXmUqIFhobmwKE_dlYrRdrRKkqOLbddgDdum9hFT_rfRwZmprPZOSxCgO1XVe89FxYh6N4itmx7YNtTIiYanG-_u8H2RqgxuTh1b__UNIA0wvYpaXWHW14BDQidM8a9aNtDJ0xAGF3QpG8I6L3zoAP0aNELQsWKPctOLNuzKlvveQgAgfwkCfAfQqtQnb_-8enbb_vn50-nM60gVh9gvt6CAOAdB-6G3ohxRMXqA6tPrDg8Ikch_0I6KwzS65GcP3_5enw-E-N7kM4GAjcR-reox9if0-K7FfNx6mpJegbGm8eEUUWxXyvyHTBe_Q8YVTyEREWvw0d1P3i5PBfvP5d53eTlKYu1rni9oAfG67VqDa4Duo8Y5z6SAIzvZ3ciXofVqb8nYXSnUQHbHuQ4Suexn7RCoy2GVNycVukMTZ1PPXapEiTShUJg_Ji-CG-17UMqQjqTDWx7elTw-xBbSVuaOfOVM48crKOVBw3osXMegQYd3jtOW-m8R0kbgC92WdQ2kLAS56a9CTO95ldADi73ZTPeNb4MWg6v5QTctDOCtLOzawPCZKUb7-JikPEnfb26W_yGI-MHxg8QLYE3T4Dx3UA0hvgL8KcYEZwcx02vaZguG-0YfzqO49F5_Pxm5M_nim9y8dZjx3izqPOTwUgWbee81LbfJKotVFM0IsE2r3ZNs623dZYMbYcil-WukWUpurrK6zzLS6WKLu9EVRV5olue8SKreZ5XRVNkG97sKpHVNd_Jbdl1gpUZXoU2G2Nu143zfaJDmLCtyizPEyMuaMJ8mHBu8QXmRcZ5PFt8G2PSy9QHVmZGBwrvWUiTwfaX-wnSH46eZPKm_a_dq8_SXRl_igXXVzp69x0lzTsSptnzWca_AQAA__9mYqDa">