summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-redundant-move.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert r368237 - Update fix-it hints for std::move warnings.Richard Trieu2019-10-021-14/+0
| | | | | | | | 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-0/+14
| | | | | | | | | | | 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
* Re-commit r321223, which adds a printing policy to the ASTDumper.Aaron Ballman2017-12-211-116/+116
| | | | | | | | This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. Fixes the -Wreorder issue and fixes the ast-dump-color.cpp test. llvm-svn: 321310
* Reverting r321223 and its follow-up commit because of failing bots due to ↵Aaron Ballman2017-12-201-116/+116
| | | | | | Misc/ast-dump-color.cpp. llvm-svn: 321229
* Add a printing policy to the ASTDumper.Aaron Ballman2017-12-201-116/+116
| | | | | | This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. llvm-svn: 321223
* Fix -Wredundant-move warning.Richard Trieu2015-07-291-76/+15
| | | | | | | | | 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
* Do not give a -Wredundant-move warning when removing the move will result in anRichard Trieu2015-07-281-1/+37
| | | | | | | | | error. If the object being moved has a move constructor and a deleted copy constructor, std::move is required, otherwise Clang will give a deleted constructor error. llvm-svn: 243463
* Change a test to follow the formatting of the rest of the tests in the file.Richard Trieu2015-07-211-6/+11
| | | | | | No functional change. llvm-svn: 242854
* [Sema] Emit correct warning when copy-elision is not possible.Davide Italiano2015-07-181-0/+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
* Have -Wredundant-move ignore reference types.Richard Trieu2015-05-181-2/+26
| | | | | | | Don't give a warning when the type being moved is a reference type. Also uncomment two lines in the test case. llvm-svn: 237607
* Add -Wpessimizing-move and -Wredundant-move warnings.Richard Trieu2015-04-291-0/+68
-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