Skip to content

[clang-tidy] "modernize-pass-by-value" - should ignore move constructors from protected/private section #140236

Open
@denzor200

Description

@denzor200
class A {
    std::string m_val;
public:
    A() = default;
    A(const A& other) = default;
    A& operator= (const A& other) = default;
protected:
    A(A&& other) = default;
    A& operator= (A&& other) = default;
};

This protected move constructor must be ignored, redundant warning with invalid fixit must not be provided. Also we should pay attention for friend classes.

Full snippet

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions