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