<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/140236>140236</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] "modernize-pass-by-value" - should ignore move constructors from protected/private section
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          denzor200
      </td>
    </tr>
</table>

<pre>
    ```
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](https://godbolt.org/z/oW317haY4)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycU9GOozgQ_JrmpZXINCGEBx6Yi_iCk073dDK4AZ-MjWzDbObrV04yO6NdaXe1EhIWXUVXV7VlCHqyzA2UL1BeM7nF2flGsX1znoTIeqduDZzF8xHtYGQI2CJULyBaRMQQFRQtFG2IXtsJl_92aaBI5XXrjR5S9QFtgS5ANUJxRcWj3Ex8AN-Lg7MhptMZXZzZ_wx8Rreyl9H5hPhd8upd5CGyeqpKXRPlz1r-mgnV9Xn4ZCKI9u9ZB_wmBhe3M94H8NsQncdlCxF7Rj1Z51kB_YWe1WaVtBFfpbfJ6lcdZ9R2l0YrHPUXHR886-7c1btdK1ZHbE1w-MoYZrcZhau8oYyRbdTO4ug8jl6zVXhPl8PxoRHKl24zBoPV68oRyivQZY5xDck86oC6yanemXh0fgLq3oA690-RV7P89wRUZ6opVF3UMuMmr05VUVN1EdncjL0YlCAeqU_flKRSjnUuOZdDqfo60w0JKkWZn3NRFkIc5aWuq6HIx4ouqj8JOAlepDZHY_Yltc90CBs3-UlQcc6M7NmE-1oTDUba6RC1ugFRWnPfJNah36YAJ2F0iOHjP1FHc78Qn2hlSpsWp9hb_caHVYZw6G-HXZqNgQgP79Y-8vohz4Cjd8tH4EDd6vUuI2PgIcWQbd4035mr47z1x8EtQF3S93wdVu_-5yECdfehA1D3nHtv6GsAAAD__0_DMRY">