[PATCH] D17811: [clang-tidy] Add check to detect dangling references in value handlers.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 10 17:17:08 PST 2016


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG. Thank you for one more awesome check!


================
Comment at: clang-tidy/misc/DanglingHandleCheck.cpp:25
@@ +24,3 @@
+std::vector<std::string> parseClasses(StringRef Option) {
+  SmallVector<StringRef, 4> Classes;
+  Option.split(Classes, HandleClassesDelimiter);
----------------
> That one is filtering the characters using isAlphanumeric.

Maybe it shouldn't ;)

Anyways, we have to converge all these, but it's not important to do it in this patch.

================
Comment at: clang-tidy/misc/DanglingHandleCheck.cpp:117
@@ +116,3 @@
+void DanglingHandleCheck::registerMatchersForVariables(MatchFinder* Finder) {
+  const auto IsAHandle = isAHandle();
+  const auto ConvertedHandle = handleFromTemporaryValue(IsAHandle);
----------------
It's fine for a follow up, if it's more convenient to you.


http://reviews.llvm.org/D17811





More information about the cfe-commits mailing list