Skip to content

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

Open
@oknenavin

Description

@oknenavin

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:

return value::move_assign<T>(*this, std::forward<basic_node>(o));

where value::move_assign returns its first argument, which is *this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++acknowledgedGitHub staff acknowledges this issuefalse-positivenot securityThis issue does not relate to a security query

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions