Support for std::unique_ptr>::operator=
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This looks outright correct to me. I have random suggestions on note text here and there.
clang/test/Analysis/smart-ptr-text-output.cpp | ||
---|---|---|
132 | I suggest: Null pointer value move-assigned to 'P'. | |
139 | I suggest: Smart pointer 'PToMove' is null; previous value moved to 'P'. Or maybe instead keep the note that the move-checker currently emits? |
clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp | ||
---|---|---|
351 | I'd prefer to call this AssignOp to avoid confusion with ==. While your naming is correct, I always found this nomenclature confusing. | |
384 | I also find the names of the variables confusing. Instead of ArgRegion what about OtherSmartPtrRegion? | |
391 | Adding return after every addTransition is a good practive that we should follow. | |
419 | Isn't this the same as the beginning of the note tag above? I wonder if there is a way to deduplicate this code. Not a huge priority though as I do not have an immediate idea for doing this in a clean way. |
clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp | ||
---|---|---|
351 | IMO it's not a question of preference with this one, EqOp is misleading. | |
399 | The grammar seems off in this one. I think it should be smith like "after being moved to" or "after it was moved to". | |
clang/test/Analysis/smart-ptr-text-output.cpp | ||
132 | +1 |
- Addressing review comments
clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp | ||
---|---|---|
351 | Changed to AssignOp | |
384 | Changed to OtherSmartPtrRegion and OtherInnerPtr | |
391 | Added return | |
399 | Changed to "after being moved to" | |
419 | Yes. | |
clang/test/Analysis/smart-ptr-text-output.cpp | ||
132 | Updated to Null pointer value move-assigned to 'P' | |
139 | Going with first option "Smart pointer 'PToMove' is null; previous value moved to 'P'" |
clang-format not found in user's PATH; not linting file.