summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/expression_command/call-function/main.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-12-03 23:06:07 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-12-03 23:06:07 +0000
commiteb4692582a295feb6a9fde46200ac123802727bc (patch)
tree13d4d9ee18cea5421ea9767475b51edeb2921485 /lldb/packages/Python/lldbsuite/test/expression_command/call-function/main.cpp
parentdf4e9ba44accb77cf4fadeaf7223d4be169cee9e (diff)
downloadbcm5719-llvm-eb4692582a295feb6a9fde46200ac123802727bc.tar.gz
bcm5719-llvm-eb4692582a295feb6a9fde46200ac123802727bc.zip
[analyzer] MoveChecker: Restrict to locals and std:: objects.
In general case there use-after-move is not a bug. It depends on how the move-constructor or move-assignment is implemented. In STL, the convention that applies to most classes is that the move-constructor (-assignment) leaves an object in a "valid but unspecified" state. Using such object without resetting it to a known state first is likely a bug. Objects Local value-type variables are special because due to their automatic lifetime there is no intention to reuse space. If you want a fresh object, you might as well make a new variable, no need to move from a variable and than re-use it. Therefore, it is not always a bug, but it is obviously easy to suppress when it isn't, and in most cases it indeed is - as there's no valid intention behind the intentional use of a local after move. This applies not only to local variables but also to parameter variables, not only of value type but also of rvalue reference type (but not to lvalue references). Differential Revision: https://reviews.llvm.org/D54557 llvm-svn: 348210
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/call-function/main.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud