11 #include "clang/AST/ASTContext.h" 12 #include "clang/ASTMatchers/ASTMatchFinder.h" 20 void NoNamespaceCheck::registerMatchers(MatchFinder *Finder) {
21 if (!getLangOpts().CPlusPlus)
25 namespaceDecl(hasName(
"::absl"), unless(isInAbseilFile()))
26 .bind(
"abslNamespace"),
30 void NoNamespaceCheck::check(
const MatchFinder::MatchResult &
Result) {
31 const auto *abslNamespaceDecl =
32 Result.Nodes.getNodeAs<NamespaceDecl>(
"abslNamespace");
34 diag(abslNamespaceDecl->getLocation(),
35 "namespace 'absl' is reserved for implementation of the Abseil library " 36 "and should not be opened in user code");
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result