#include "VirtualClassDestructorCheck.h"
#include "../utils/LexerUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
#include <optional>
#include <string>
usingnamespaceclang::ast_matchers;
namespace clang::tidy::cppcoreguidelines {
AST_MATCHER(CXXRecordDecl, hasPublicVirtualOrProtectedNonVirtualDestructor) { … }
void VirtualClassDestructorCheck::registerMatchers(MatchFinder *Finder) { … }
static std::optional<CharSourceRange>
getVirtualKeywordRange(const CXXDestructorDecl &Destructor,
const SourceManager &SM, const LangOptions &LangOpts) { … }
static const AccessSpecDecl *
getPublicASDecl(const CXXRecordDecl &StructOrClass) { … }
static FixItHint
generateUserDeclaredDestructor(const CXXRecordDecl &StructOrClass,
const SourceManager &SourceManager) { … }
static std::string getSourceText(const CXXDestructorDecl &Destructor) { … }
static std::string eraseKeyword(std::string &DestructorString,
const std::string &Keyword) { … }
static FixItHint changePrivateDestructorVisibilityTo(
const std::string &Visibility, const CXXDestructorDecl &Destructor,
const SourceManager &SM, const LangOptions &LangOpts) { … }
void VirtualClassDestructorCheck::check(
const MatchFinder::MatchResult &Result) { … }
}