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 | ||
---|---|---|
131 | I suggest: Null pointer value move-assigned to 'P'. | |
138 | 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 | ||
---|---|---|
353 | I'd prefer to call this AssignOp to avoid confusion with ==. While your naming is correct, I always found this nomenclature confusing. | |
386 | I also find the names of the variables confusing. Instead of ArgRegion what about OtherSmartPtrRegion? | |
393 | Adding return after every addTransition is a good practive that we should follow. | |
421 | 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 | ||
---|---|---|
353 | IMO it's not a question of preference with this one, EqOp is misleading. | |
401 | 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 | ||
131 | +1 |
- Addressing review comments
clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp | ||
---|---|---|
353 | Changed to AssignOp | |
386 | Changed to OtherSmartPtrRegion and OtherInnerPtr | |
393 | Added return | |
401 | Changed to "after being moved to" | |
421 | Yes. | |
clang/test/Analysis/smart-ptr-text-output.cpp | ||
131 | Updated to Null pointer value move-assigned to 'P' | |
138 | Going with first option "Smart pointer 'PToMove' is null; previous value moved to 'P'" |
I'd prefer to call this AssignOp to avoid confusion with ==. While your naming is correct, I always found this nomenclature confusing.