12 #include "clang/AST/ASTContext.h" 13 #include "clang/ASTMatchers/ASTMatchFinder.h" 21 void NoInternalDependenciesCheck::registerMatchers(MatchFinder *Finder) {
22 if (!getLangOpts().CPlusPlus)
29 nestedNameSpecifierLoc(loc(specifiesNamespace(namespaceDecl(
30 matchesName(
"internal"),
31 hasParent(namespaceDecl(hasName(
"absl")))))),
32 unless(isInAbseilFile()))
37 void NoInternalDependenciesCheck::check(
const MatchFinder::MatchResult &
Result) {
38 const auto *InternalDependency =
39 Result.Nodes.getNodeAs<NestedNameSpecifierLoc>(
"InternalDep");
41 diag(InternalDependency->getBeginLoc(),
42 "do not reference any 'internal' namespaces; those implementation " 43 "details are reserved to Abseil");
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//