[C++20] [P1825] More implicit moves
authorYang Fan <nullptr.cpp@gmail.com>
Tue, 16 Feb 2021 21:09:26 +0000 (16:09 -0500)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Tue, 16 Feb 2021 22:24:20 +0000 (17:24 -0500)
commitfbee4a0c79cc4ee87c34e51342742a5bc6fcf872
tree6ba7cc030eabf34e2aa61c8c9d8590e3b7a66767
parent16af97393346ad636298605930a8b503a55eb40a
[C++20] [P1825] More implicit moves

Implement all of P1825R0:

- implicitly movable entity can be an rvalue reference to non-volatile
    automatic object.
- operand of throw-expression can be a function or catch-clause parameter
    (support for function parameter has already been implemented).
- in the first overload resolution, the selected function no need to be
    a constructor.
- in the first overload resolution, the first parameter of the selected
    function no need to be an rvalue reference to the object's type.

This patch also removes the diagnostic `-Wreturn-std-move-in-c++11`.

Differential Revision: https://reviews.llvm.org/D88220
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaCoroutine.cpp
clang/lib/Sema/SemaStmt.cpp
clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
clang/test/SemaCXX/P1155.cpp [new file with mode: 0644]
clang/test/SemaCXX/warn-return-std-move.cpp
clang/www/cxx_status.html