Details
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
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Nice check! One comment (quite usual ;).
test/clang-tidy/readability-uniqueptr-delete-release.cpp | ||
---|---|---|
25 ↗ | (On Diff #35764) | I'd anchor the pattern to the start of line to verify correct replacement of "delete ". |
36 ↗ | (On Diff #35764) | 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 | ||
---|---|---|
19 ↗ | (On Diff #35901) | Is there a reason for = nullptr instead of .reset(); ? |
clang-tidy/readability/UniqueptrDeleteReleaseCheck.h | ||
---|---|---|
19 ↗ | (On Diff #35901) | Preference of the author and initial reviewer? |
Comment Actions
LGTM!
clang-tidy/readability/UniqueptrDeleteReleaseCheck.h | ||
---|---|---|
19 ↗ | (On Diff #35901) | 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. |