-
- Downloads
Add -Wpessimizing-move and -Wredundant-move warnings.
-Wpessimizing-move warns when a call to std::move would prevent copy elision if the argument was not wrapped in a call. This happens when moving a local variable in a return statement when the variable is the same type as the return type or using a move to create a new object from a temporary object. -Wredundant-move warns when an implicit move would already be made, so the std::move call is not needed, such as when moving a local variable in a return that is different from the return type. Differential Revision: http://reviews.llvm.org/D7633 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236075 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Basic/DiagnosticGroups.td 2 additions, 0 deletionsinclude/clang/Basic/DiagnosticGroups.td
- include/clang/Basic/DiagnosticSemaKinds.td 11 additions, 0 deletionsinclude/clang/Basic/DiagnosticSemaKinds.td
- lib/Sema/SemaInit.cpp 112 additions, 0 deletionslib/Sema/SemaInit.cpp
- test/SemaCXX/warn-pessmizing-move.cpp 203 additions, 0 deletionstest/SemaCXX/warn-pessmizing-move.cpp
- test/SemaCXX/warn-redundant-move.cpp 68 additions, 0 deletionstest/SemaCXX/warn-redundant-move.cpp
Loading
Please register or sign in to comment