#include "VirtualNearMissCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
usingnamespaceclang::ast_matchers;
namespace clang::tidy::bugprone {
namespace {
AST_MATCHER(CXXMethodDecl, isStatic) { … }
AST_MATCHER(CXXMethodDecl, isOverloadedOperator) { … }
}
static bool isOverrideMethod(const CXXMethodDecl *MD) { … }
static bool checkOverridingFunctionReturnType(const ASTContext *Context,
const CXXMethodDecl *BaseMD,
const CXXMethodDecl *DerivedMD) { … }
static QualType getDecayedType(QualType Type) { … }
static bool checkParamTypes(const CXXMethodDecl *BaseMD,
const CXXMethodDecl *DerivedMD) { … }
static bool checkOverrideWithoutName(const ASTContext *Context,
const CXXMethodDecl *BaseMD,
const CXXMethodDecl *DerivedMD) { … }
static bool checkOverrideByDerivedMethod(const CXXMethodDecl *BaseMD,
const CXXMethodDecl *DerivedMD) { … }
bool VirtualNearMissCheck::isPossibleToBeOverridden(
const CXXMethodDecl *BaseMD) { … }
bool VirtualNearMissCheck::isOverriddenByDerivedClass(
const CXXMethodDecl *BaseMD, const CXXRecordDecl *DerivedRD) { … }
void VirtualNearMissCheck::registerMatchers(MatchFinder *Finder) { … }
void VirtualNearMissCheck::check(const MatchFinder::MatchResult &Result) { … }
}