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