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

    <tr>
        <th>Summary</th>
        <td>
            Clang-tidy: bugprone-use-after-move: false negative
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Reproduction:
````
// https://compiler-explorer.com/z/8asKxxeGh
// clang++ -std=c++20 -stdlib=libc++  -Weverything -Wno-c++98-compat -Wno-missing-prototypes t.cpp
// clang-tidy -checks=bugprone-use-after-move
#include <utility>

struct C {};

struct S {
    auto g(C c) -> void;
};

auto f(C &c) -> S;

int main(int, char**) {
 auto c = C{};
 f(c).g(std::move(c));
}

````

Expected:
````
[<source>:13:7: warning: 'c' used after it was moved [bugprone-use-after-move]]
 f(c).g(std::move(c));
      ^
[<source>:13:12: note: move occurred here]
    f(c).g(std::move(c));
           ^
[<source>:13:7: note: the use and move are unsequenced, i.e. there is no guarantee about the order in which they are evaluated]
    f(c).g(std::move(c));
      ^
1 warning generated.
````

When the argument of `f` is changed from `C &c` to either `const C &c` or `C c`, the expected warning shows up. However, when the class is an (in/)out argument, this does not show. I don't believe there is a difference in the sequence of execution for these cases, so the warning should happen in all cases.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVUmP6zYM_jXKhbDhyHEcH3zIMul26wM6Z1mmbbWK5GpJJv31BZXMZN42KF4DwY65fPxISqLwXo0GsWXVjlWHhYhhsq799Y_tjGbR2f7a_o6zs32UQVnDyi0rDqzYsnXxWDcJPzJ-hCmE2ZNZ-pT2NCuNLsOXWVuHLpf2xPjxH8aPG-F_e3nBn6bP_KUWZmR8x_gOMh96Vh7k7ZMXSaBVx8qDVt1dDJA94xndNUzKjJA9G5vdVc0mIwIi3KQn5b0yYzY7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