clang-tools 22.0.0git
clang::ast_matchers Namespace Reference

Functions

 AST_POLYMORPHIC_MATCHER (isInAbseilFile, AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc, NestedNameSpecifierLoc))
 Matches AST nodes that were found within Abseil files.

Function Documentation

◆ AST_POLYMORPHIC_MATCHER()

clang::ast_matchers::AST_POLYMORPHIC_MATCHER ( isInAbseilFile ,
AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc, NestedNameSpecifierLoc)  )

Matches AST nodes that were found within Abseil files.

Example matches Y but not X (matcher = cxxRecordDecl(isInAbseilFile())

#include "absl/strings/internal-file.h"
class X {};
static clang::FrontendPluginRegistry::Add< clang::tidy::ClangTidyPluginAction > X("clang-tidy", "clang-tidy")

absl/strings/internal-file.h:

class Y {};

Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>, Matcher<NestedNameSpecifierLoc>

Definition at line 30 of file AbseilMatcher.h.