[PATCH] D72282: [clang-tidy] Add `bugprone-unintended-adl`

Logan Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 8 09:03:42 PST 2021


logan-5 added a comment.

It's been a year and a half since I heard anything about this patch and I'd honestly kind of forgotten about it. I'm still around/lurking though, and would assist with getting it landed if it's still good to go.



================
Comment at: clang-tools-extra/clang-tidy/bugprone/UnintendedADLCheck.cpp:27
+  Decl.printNestedNameSpecifier(OS, Decl.getASTContext().getPrintingPolicy());
+  return OS.str();
+}
----------------
Oops: this should maybe be `OS.flush(); return N;` so that N is NRVO'd or else implicit-moved. `return OS.str();` does a copy.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/UnintendedADLCheck.cpp:127
+    OS << ", '" << (*Begin)->getType().getAsString() << "'";
+  return Result;
+}
----------------
I can't imagine it super matters for raw_string_ostream, but I think pedantically this needs an `OS.flush()` before the return.


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

https://reviews.llvm.org/D72282



More information about the cfe-commits mailing list