Index: clang-tidy/misc/UnusedUsingDeclsCheck.cpp =================================================================== --- clang-tidy/misc/UnusedUsingDeclsCheck.cpp +++ clang-tidy/misc/UnusedUsingDeclsCheck.cpp @@ -35,6 +35,10 @@ const auto *TargetDecl = Using->shadow_begin()->getTargetDecl()->getCanonicalDecl(); + // Ignores using-declarations defined in macros. + if (TargetDecl->getLocation().isMacroID()) + return; + // Ignores using-declarations defined in class definition. if (isa(TargetDecl->getDeclContext())) return; Index: test/clang-tidy/misc-unused-using-decls.cpp =================================================================== --- test/clang-tidy/misc-unused-using-decls.cpp +++ test/clang-tidy/misc-unused-using-decls.cpp @@ -70,6 +70,14 @@ using n::cout; using n::endl; +#define DEFINE_INT(name) \ + namespace INT { \ + static const int _##name = 1; \ + } \ + using INT::_##name +DEFINE_INT(test); +#undef DEFIND_INT + // ----- Usages ----- void f(B b); void g() {