Details
- Reviewers
aaron.ballman alexfh - Commits
- rGdaef16319972: Added check uniqueptr-delete-release to replace "delete x.release()" with "x =…
rCTE250742: Added check uniqueptr-delete-release to replace "delete x.release()" with "x =…
rL250742: Added check uniqueptr-delete-release to replace "delete x.release()" with "x…
Diff Detail
Event Timeline
Nice check! One comment (quite usual ;).
test/clang-tidy/readability-uniqueptr-delete-release.cpp | ||
---|---|---|
25 | I'd anchor the pattern to the start of line to verify correct replacement of "delete ". | |
36 | Please add tests for code in templates with multiple instantiations and for code in macros. I suspect these cases need special treatment, which is not currently done. |
clang-tidy/readability/UniqueptrDeleteReleaseCheck.h | ||
---|---|---|
20 | Is there a reason for = nullptr instead of .reset(); ? |
clang-tidy/readability/UniqueptrDeleteReleaseCheck.h | ||
---|---|---|
20 | Preference of the author and initial reviewer? |
LGTM!
clang-tidy/readability/UniqueptrDeleteReleaseCheck.h | ||
---|---|---|
20 | While equivalent, one may be considered more readable than another (in either direction!). For me, personally, I prefer seeing .reset() because it's a reminder to me that this object is also being destroyed. I don't have overly strong opinions though, and don't think it's worth some sort of user-configurability. |
Is there a reason for = nullptr instead of .reset(); ?