]> granicus.if.org Git - clang/commit
[analyzer] MoveChecker: Improve warning and note messages.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 4 Dec 2018 02:00:29 +0000 (02:00 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 4 Dec 2018 02:00:29 +0000 (02:00 +0000)
commit2e8d7182c2c18e961dfb34dcb84c70baf98e2549
tree68d9eb82d7486c773b2beacfadb3663c7ab49647
parent6ca088cb680ffccca83bc183cb7d19190887f473
[analyzer] MoveChecker: Improve warning and note messages.

The warning piece traditionally describes the bug itself, i.e.
"The bug is a _____", eg. "Attempt to delete released memory",
"Resource leak", "Method call on a moved-from object".

Event pieces produced by the visitor are usually in a present tense, i.e.
"At this moment _____": "Memory is released", "File is closed",
"Object is moved".

Additionally, type information is added into the event pieces for STL objects
(in order to highlight that it is in fact an STL object), and the respective
event piece now mentions that the object is left in an unspecified state
after it was moved, which is a vital piece of information to understand the bug.

Differential Revision: https://reviews.llvm.org/D54560

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348229 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/MoveChecker.cpp
test/Analysis/use-after-move.cpp