32 const auto *D = Result.Nodes.getNodeAs<Decl>(
"using_decl");
34 if (D->getBeginLoc().isMacroID())
38 if (Result.SourceManager->isInMainFile(
39 Result.SourceManager->getExpansionLoc(D->getBeginLoc())) &&
41 getHeaderFileExtensions()))
44 if (
const auto *UsingDirective = dyn_cast<UsingDirectiveDecl>(D);
46 UsingDirective->getNominatedNamespace()->isAnonymousNamespace()) {
54 diag(D->getBeginLoc(),
55 "using declarations in the global namespace in headers are prohibited");
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.