github / github/codeql

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

Aperta
#7,035 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub
acknowledged C++ false-positive not security
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

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`.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.