[PATCH] D97630: [clang-tidy] Added option to uniqueptr delete release check

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 1 13:09:57 PST 2021


njames93 added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/readability-uniqueptr-delete-release.cpp:40
+
+  delete (P2.release());
+  // CHECK-MESSAGES-NULLPTR: :[[@LINE-1]]:3: warning: prefer '= nullptr'
----------------
aaron.ballman wrote:
> njames93 wrote:
> > aaron.ballman wrote:
> > > Not that I expect this to come up particularly often, but, how about: `delete (P2.release)();`
> > I don't think Im gonna worry about those given how infrequently bound member functions are used.
> I'm fine with that, but it does come up from people who loathe ADL shenanigans. That said, if it comes up *here*, I'd be surprised.
In its current config it wont detect it at all. I got it to detect bound member functions but the fix-its never seemed to work properly. I've just left it as it. so no warning or (corrupted fix-it).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97630/new/

https://reviews.llvm.org/D97630



More information about the cfe-commits mailing list