<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJy9VsmO2zgQ_Rr5QrShptpt-6CDe3oC5JDbAHMMKKpkMaFIhYs9_vupohbL3XGCIIMBZNkiq4rvvVrkytaXMnvOh0v2fZa_Zvkh44UyUscaWFb8oawPDkSXFX-O2-kutfCefbInGFe3L8OPPlZayaw4TNb7ZMR3Gd9jvFdWQyOiDlnxsox3tZPW-DBE5s_Mhhbc1VVDgLueo8_SbTYZr-LA_Gc09aEmiMWhG1yT_Zq29jde25dlhNlL2hhIHLxYxvkQhE8rsxmYWi_QYrjXN8gHsrMDSq3MkQj4SbFbBA5CdIY43A_bO3USJNP1mDcHkD_G5Rwf8U7-c7jl73T3QQQl2cmqmjWf3Uno-Ebs7irZAu09saYY7IEtNOvWM-MfinhL9RabtP1lRPbLmMj3P0c0-L-HMSJcpHAh7NvS7MaaLF4Q3Qe8mLGM9hCuFFg91ujLTxle2fwayelM7HdzfAiqvjBpu14LZTwTFR1CWGp2Ek6JSgOrgCoseqi_06Ws47e0x5y9I83fsRYyRKEH5q3oezDUKj_lze8Q5_8D89vSUAY90PteVUzlstBnbPf8O9U2je3lCYeKxJEWJ_dZac0QY48wcbaxxmptz6TYPBZuIyzakqZCWlsWzXVxnvlz11z3Fmr_AOdfrfIMry8Ry1cwL1BWTKo6tho_gVQkzJiu3llUFluAr9lHBv_0IANKvshJsOwsUKMhI-RmrHk4W_eVwqRq8apTWrhk2oJhFxtZcMlVCpRJsCYaGZQ1KFto8XkYyw4acGAkrAfYH5noENTO2DMxFHgu4IkiMBWIznSo8FekFYJaoEWrqYiSZQItxkKy1Rd0WpQRE00AN-RvQpgQwwlphNbGY0u7CAMDT2Nhbg5kq2RLW9-iClQYpomeNh6YMDXrrfeq0hcSQGgPtKCCOk18p2RRdI-VoUyCYp06KoOtOBQasqXVWjVJrcC0aiCoDg2bwT7RwlbqoKuQDiKQmBTbJUQ-duA82aKIiTT5jLXYCyc6fOU7zH5IR83CJt3JdIyKLI_WwF3JKBGNpR2LTHFwgqcTPU7rr9jPzkZUJJqgdHL2WNrAcBT4EW86iuQ1KL4bRfbrVV0W9b7Yi5WIGNqVjXJwFidYRafLNoTeU8elUXLE4orVGgsAH7Q-TV8PWOWjRElobKEPmyLfFau2zCGv-SM8Qd1suNzwPW92hYR9U22KffNUrLSoQPsy29D73MB5yBW91Tevq99HoEqec54_5rs8f9xtntfP26fdJq_3Ysu3QgLPnnLAqabXFGdt3XHlyhSyikePm1r54K-b-K9RHQ1AAowIgwoayr-vHTxk5pyKWrCb98JiZKQXH9XwVPS41YPDBHdQrxKHMhH4F0Z4RHQ>53083</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Warn about cases where a std::move is just a cast and no move is performed
        </td>
    </tr>

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

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

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

<pre>
    ```cpp
#include <iostream>

class Move
{
public:
        Move() = default;

        Move(const Move& other) = delete;

        Move(Move&& other)
                        : s_(std::move(other.s_))
        {
                std::cout << "move" << std::endl;
        }

        const std::string& s() {
                return s_;
        }

private:
        std::string s_{"str"};
};

static void f_rvalue(Move&& m)
{
        std::cout << "f_rvalue - " << m.s() << std::endl;
}

static void f_copy(Move m)
{
        std::cout << "f_copy - " << m.s() << std::endl;
}

static void f()
{
        Move m;
        f_rvalue(std::move(m)); // no move - cast only
        std::cout << "m.s() - " << m.s() << std::endl; // clang-tidy complains about moved variable being used

        Move m2;
        f_copy(std::move(m2)); // actual move happening
        std::cout << "m2.s() - " << m2.s() << std::endl; // clang-tidy complains about moved variable being used
}

int main()
{
        f();
        return 0;
}
```

Above code will output the following:
```
f_rvalue - str
m.s() - str
move
f_copy - str
m2.s() -
```

This is just a sample highlighting the "problem". I expected clang-tidy to warn about the non-working move similar to when you try to call a function with a const reference.
I am (now) aware that it is working as expected but clang-tidy is complaining about a moved object being used after the function call even though there is no move happening which is quite confusing - and possibly a false positive.

The issue in the original code was the different lifetime of the object/member since some consumers of it used the rvalue parameter. It was expected that the member is gone after the function call but for those cases it sticks around until the scope ends since the move never happens.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VsmO4zYQ_Rr5QtiQpfZ20MGdzgBzyC1AjgOKKkmcoUiFix3_faqoxXL3eAYDBAHUtiXW8t6rpVWa6lYk-3S4RN8n6VuSnpMsl1qoUAFL8t-kcd4C75L89_E4fgrFnWN_mAuMTw-vw48-lEqKJD9P1qdolB2T7ITx3lgFNQ_KJ_nrMt7dThjt_BA52zPjW7B3VwUennqOPku32WS88jNzX9DU-Yog5uducI32Gzo6PXgdXpcRZi9hgidx8GJJlg1BsunJbAa6Ugu0GO7tHfKB7OyAUkvdEAE3KfaIwIIPVhOH52F7Ky-cZLqneZeA_DFuluEtfpL_HG75O346z70U7GJkxeov9sJVeCd2d5dsgfaZWFMMtmYLzbrNzPiHIj5SfcQmTH8bkf0yJvL9zxEN_h9hjAgXJVwI-741u7En81dE9wkvpg2jM4QrOHaP0er2U4Z3Nr9GcsqJ866btZfVjQnT9YpL7RgvKQlhqdiFW8lLBawE6rDgoPrOlLIue6Q91uwD6ewDay584Gpg3vK-B02j8lPe2RPi2f_A_LE1pEYP9H7WFVO7LPQZxz39TrdNa3uZ4VySOMLg5r5KpRhi7BEm7jZWG6XMlRSb18JjhMVY0laIz5ZNc3847_x5au5nC7V_gPPPVjqG19eA7cuZ4ygrFlU2rcI_TyoSZixXbw0qiyOQbdhnBv_0IDxKvqiJN-zKUaOhIuSmjV5fjf1GYWK3ONlJxW00bUGzmwnM2-gqOMrEWR208NJolM23eD-sZQs1WNACNgPsz4x3COqozZUYcswLmJF7Jj3RmZJyd0daIqgFWrSamihaRtB8bCRTfkWnRRsxXnuwQ_0mhBExXJCGb01oWjpFGBh4WgvzcCBbKVo6-jtIT42h6-DoY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