Skip to content

[clang-tidy] False positive cppcoreguidelines-rvalue-reference-param-not-moved when constructor is deleted #69412

Closed
@ChrisThrasher

Description

@ChrisThrasher

https://godbolt.org/z/dnE37P4c4

struct S
{
    S(const int&);
    S(int&&) = delete;
};

SFML uses this pattern where const& overloads are kept while && overloads are deleted to prevent constructor from temporary values. The && overloads get flagged by cppcoreguidelines-rvalue-reference-param-not-moved in spite of them being deleted and thus having no function body.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions