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

    <tr>
        <th>Summary</th>
        <td>
            Inconsistent documentation about -Wreturn-std-move
        </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>
    Clang diagnostic flags and clang-tidy documentation claim something different about the -Wreturn-std-move flag. (I assume clang-tidy is wrong and not updated after the change of behavior)
In LLVM 10.0.0 the -Wreturn-std-move flag was a real warning, in LLVM 13.0.0 this warning no longer is triggered on the same code. I assume that in one of the releases, the warning was removed.

On the diagnostics reference (https://clang.llvm.org/docs/DiagnosticsReference.html#wreturn-std-move), it states:
> This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

Similar functionality exists also as a clang-tidy warning (performance-no-automatic-move).
This has a dedicated section about this warning: https://clang.llvm.org/extra/clang-tidy/checks/performance/no-automatic-move.html#wreturn-std-move, which states:
> In that case the fix is more consensual: just return std::move(obj). This is handled by the -Wreturn-std-move warning.

For sure, some documentation is wrong. It also raises the question on the mentioned use-case as the documentation seems to suggest that this isn't covered by clang-tidy.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVMFu6zYQ_Br6srAgU3biHHRInbpw8YoCbfF6XpErialEutxVHP99QcpO4ry-9mJDIHd2dma4yOw6T1SrzQ9q87TASfoQ65-_Ph7JL5pgz_VuQN-Bddj5wOIMtAN2DOgtmHS0FGfPYIOZRvKC4oJPB24EDiNJ73J121IkL4BNmASkJ1j-GUmm6JcsdjmGF8rABSi9PQAyTyN9bOAYTjH4Ljf2QWA6WhSygK1QzIimR98RhBYa6vHFhaj0gyqfVPl48PDly9dfYFUWZVH-R384IQNCJBzghNE73ym9A3etry71ic58DD7AEHxHMXGU6LqOIlkIPrdhTHMESwW8jSU9SoIMPrNN1yINhEycmqXvK3iiEynRs8U8yvz764z-bku6ljU2lCTsRY6sqkel90rvs47FMLyMRYid0nsbDCu9f3ov_-1aXfQyDkpXp0_yJC2TEgIsKJTBZ0LVj_BHEuRTRoBeHQtDGyL8tNuBCeMRxTVucHJOUMnJHjkJSG1LJmuS43Yz6u9udANGaCdvUrow1V_BceAA2bIPWbmKp_T2SLENcURvaOnDEicJI4oz15EunTL_PuNYss7kZDHlfm-ZffdcVY_wPwrTq0S8HmRa6aMn81cS_gMtpfffEPu-Bzs49c70_-bBwc_BMsiUw9G61xTJMcSUQM_kecIhcX-eWGDGBhabYKrHucE2NM9Jl9nSrIq3A1lozt95NhdNbjzbhwg8xUw4rYFP--H6mAs4yGxhRMfEucPfE3G-dXlBqcwFTxYmpmWeDuebt6BMNDJIAJ66jlhmNWQewyt9L2DCS36bzflDXC7EF7au7EP1gAuqV3cP1fpue1etF31NZrvabtZNafDOVmQrW1Ya6YGs3jTb--3C1brUVbmtVuX95n61LoymtiRT6grXjb7fqHVJI7rhLR8LxzxRfbdZVdViwIYGzhtYa08nyIdK67SQY51qls3UsVqXQ8r8O4o4Gag--GSuY0n79VaSObnfWLaY4lDf5rdz0k9NYcKo9D41uPwtjzE8kxGl95lWCm-m_U8AAAD__452Iek">