github / github/codeql

LGTM.com - false positive for move and copy assignment operators not returning *this (C++)

未关闭
#7,035 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
acknowledged C++ false-positive not security
主要语言
CodeQL
星标
10.1k
派生
2.1k
平均合并
2 天 15 小时
30 天内合并 PR
141

描述

The error is reported for these operators when `*this` is returned indirectly via a function call. For example:

https://lgtm.com/projects/g/oknenavin/cxon/snapshot/9103621a01a81595999681a97870d8930d56aa58/files/src/cxon/lang/cbor/node/node.hxx?sort=name&dir=ASC&mode=heatmap#xc6e83398218bd018:1

we have:
``` c++
return value::move_assign(*this, std::forward(o));
```
where `value::move_assign` returns its first argument, which is `*this`.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。