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

Logan Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 7 16:55:46 PST 2020


logan-5 marked 2 inline comments as done.
logan-5 added a comment.

@JonasToth Thanks for the feedback. Will be updating the diff in the next day or so.



================
Comment at: clang-tools-extra/clang-tidy/bugprone/UnintendedADLCheck.cpp:89
+
+    const auto *Lookup =
+        Result.Nodes.getNodeAs<UnresolvedLookupExpr>("templateADLexpr");
----------------
JonasToth wrote:
> Can't you just bind directly to the `unresolvedExpr`?
I need the `"templateADLCall"` node for the diagnostic caret, and the `"templateADLexpr"` for the name/spelling of the call. I might totally be misunderstanding what you're suggesting here.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-unintended-adl.cpp:1
+// RUN: %check_clang_tidy -std=c++14-or-later %s bugprone-unintended-adl %t
+
----------------
JonasToth wrote:
> why 14 or later? `ADL` exists in the prior standards, too.
> 
> Additionally we need a test for where overloaded operators are not ignored and create the warnings.
14 or later just because of the generic lambdas in some of the tests. Is it worth separating those tests out into their own files so that we don't have to pass this flag here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72282





More information about the cfe-commits mailing list