summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-pessmizing-move.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert r368237 - Update fix-it hints for std::move warnings.Richard Trieu2019-10-021-36/+44
| | | | | | | | r368237 attempted to improve fix-its for move warnings, but introduced some regressions to -Wpessimizing-move. Revert that change and add the missing test cases to the pessimizing move test to prevent future regressions. llvm-svn: 373421
* Update fix-it hints for std::move warnings.Richard Trieu2019-08-081-8/+35
| | | | | | | | | | | Fix -Wpessimizing-move and -Wredundant-move when warning on initializer lists. The new fix-it hints for removing the std::move call will now also suggest removing the braces for the initializer list so that the resulting code will still be compilable. This fixes PR42832 llvm-svn: 368237
* Fix -Wredundant-move warning.Richard Trieu2015-07-291-7/+1
| | | | | | | | | Without DR1579 implemented, the only case for -Wredundant-move is for a parameter being returned with the same type as the function return type. Also include a check to verify that the move constructor will be used by matching nodes in the AST dump. llvm-svn: 243594
* Disable -Wpessimizing-move and -Wredundant-move in template instantiations.Richard Trieu2015-07-291-0/+37
| | | | | | | | | Dependent types can throw off the analysis for these warnings, possibly giving conflicting warnings and fix-its. Disabling the warning in template instantiations will prevent this problem, and will still catch the non-dependent cases in templates. llvm-svn: 243538
* [Sema] Emit correct warning when copy-elision is not possible.Davide Italiano2015-07-181-12/+7
| | | | | | | | | | If we're returning a function parameter, copy elision isn't possible, so we now warn for redundant move. PR: 23819 Differential Revision: http://reviews.llvm.org/D11305 llvm-svn: 242600
* Add -Wpessimizing-move and -Wredundant-move warnings.Richard Trieu2015-04-291-0/+203
-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 llvm-svn: 236075
OpenPOWER on IntegriCloud