[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

Don Hinton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 25 18:31:37 PDT 2019


hintonda marked an inline comment as done.
hintonda added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h:17
 
+using llvm::SmallSet;
+
----------------
Eugene.Zelenko wrote:
> It'll be easier to use llvm::SmallSet in using statement.
Unfortunately, that won't compile.

The reason is that the llvm checkers live in `namespace clang::clang-tidy::llvm`, so if you include an llvm checker header, which opens the `clang::clang-tidy::llvm` namespace, clang doesn't know whether to look in `llvm` or `clang::clang-tidy::llvm` since you are in `clang::clang-tidy`.

The error does suggest using `::llvm::SmallSet`, but that seems sorta klugey.

Since this looks ugly, how about I add `using llvm::SmallSet;` to ` clang/include/clang/LLVM.h`?



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59802





More information about the cfe-commits mailing list