10 #include "clang/AST/ASTContext.h" 11 #include "clang/ASTMatchers/ASTMatchFinder.h" 17 namespace cppcoreguidelines {
19 void ProTypeReinterpretCastCheck::registerMatchers(MatchFinder *Finder) {
20 if (!getLangOpts().CPlusPlus)
23 Finder->addMatcher(cxxReinterpretCastExpr().bind(
"cast"),
this);
26 void ProTypeReinterpretCastCheck::check(
27 const MatchFinder::MatchResult &
Result) {
28 const auto *MatchedCast =
29 Result.Nodes.getNodeAs<CXXReinterpretCastExpr>(
"cast");
30 diag(MatchedCast->getOperatorLoc(),
"do not use reinterpret_cast");
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result