#include "UseNodiscardCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Type.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
usingnamespaceclang::ast_matchers;
namespace clang::tidy::modernize {
static bool doesNoDiscardMacroExist(ASTContext &Context,
const llvm::StringRef &MacroId) { … }
namespace {
AST_MATCHER(CXXMethodDecl, isOverloadedOperator) { … }
AST_MATCHER(CXXMethodDecl, isConversionOperator) { … }
AST_MATCHER(CXXMethodDecl, hasClassMutableFields) { … }
AST_MATCHER(ParmVarDecl, hasParameterPack) { … }
AST_MATCHER(CXXMethodDecl, hasTemplateReturnType) { … }
AST_MATCHER(CXXMethodDecl, isDefinitionOrInline) { … }
AST_MATCHER(QualType, isInstantiationDependentType) { … }
AST_MATCHER(QualType, isNonConstReferenceOrPointer) { … }
}
UseNodiscardCheck::UseNodiscardCheck(StringRef Name, ClangTidyContext *Context)
: … { … }
void UseNodiscardCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
void UseNodiscardCheck::registerMatchers(MatchFinder *Finder) { … }
void UseNodiscardCheck::check(const MatchFinder::MatchResult &Result) { … }
bool UseNodiscardCheck::isLanguageVersionSupported(
const LangOptions &LangOpts) const { … }
}