9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USETRAILINGRETURNTYPECHECK_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USETRAILINGRETURNTYPECHECK_H
12#include "../ClangTidyCheck.h"
13#include "clang/Lex/Token.h"
33 return LangOpts.CPlusPlus11;
37 Preprocessor *ModuleExpanderPP)
override;
38 void check(
const ast_matchers::MatchFinder::MatchResult &Result)
override;
41 Preprocessor *PP =
nullptr;
43 SourceLocation findTrailingReturnTypeSourceLocation(
44 const FunctionDecl &F,
const FunctionTypeLoc &FTL,
const ASTContext &Ctx,
45 const SourceManager &SM,
const LangOptions &LangOpts);
46 std::optional<SmallVector<ClassifiedToken, 8>>
47 classifyTokensBeforeFunctionName(
const FunctionDecl &F,
const ASTContext &Ctx,
48 const SourceManager &SM,
49 const LangOptions &LangOpts);
50 SourceRange findReturnTypeAndCVSourceRange(
const FunctionDecl &F,
51 const TypeLoc &ReturnLoc,
52 const ASTContext &Ctx,
53 const SourceManager &SM,
54 const LangOptions &LangOpts);
55 void keepSpecifiers(std::string &
ReturnType, std::string &Auto,
56 SourceRange ReturnTypeCVRange,
const FunctionDecl &F,
57 const FriendDecl *Fr,
const ASTContext &Ctx,
58 const SourceManager &SM,
const LangOptions &LangOpts);
llvm::SmallString< 256U > Name
Base class for all clang-tidy checks.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Rewrites function signatures to use a trailing return type.
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Override this to disable registering matchers and PP callbacks if an invalid language version is bein...
void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
Override this to register PPCallbacks in the preprocessor.
UseTrailingReturnTypeCheck(StringRef Name, ClangTidyContext *Context)
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.