clang-tools 22.0.0git
clang::tidy::bugprone::LambdaFunctionNameCheck Class Reference

Detect when func or FUNCTION is being used from within a lambda. More...

#include <LambdaFunctionNameCheck.h>

Inheritance diagram for clang::tidy::bugprone::LambdaFunctionNameCheck:
[legend]

Classes

struct  SourceRangeLessThan

Public Types

using SourceRangeSet = std::set<SourceRange, SourceRangeLessThan>

Public Member Functions

 LambdaFunctionNameCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

Detect when func or FUNCTION is being used from within a lambda.

In that context, those expressions expand to the name of the call operator (i.e., operator()).

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/lambda-function-name.html

Definition at line 22 of file LambdaFunctionNameCheck.h.

Member Typedef Documentation

◆ SourceRangeSet

Constructor & Destructor Documentation

◆ LambdaFunctionNameCheck()

clang::tidy::bugprone::LambdaFunctionNameCheck::LambdaFunctionNameCheck ( StringRef Name,
ClangTidyContext * Context )

Definition at line 64 of file LambdaFunctionNameCheck.cpp.

Member Function Documentation

◆ check()

void clang::tidy::bugprone::LambdaFunctionNameCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 89 of file LambdaFunctionNameCheck.cpp.

◆ isLanguageVersionSupported()

bool clang::tidy::bugprone::LambdaFunctionNameCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 35 of file LambdaFunctionNameCheck.h.

◆ registerMatchers()

void clang::tidy::bugprone::LambdaFunctionNameCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 73 of file LambdaFunctionNameCheck.cpp.

◆ registerPPCallbacks()

void clang::tidy::bugprone::LambdaFunctionNameCheck::registerPPCallbacks ( const SourceManager & SM,
Preprocessor * PP,
Preprocessor * ModuleExpanderPP )
override

Definition at line 83 of file LambdaFunctionNameCheck.cpp.

References clang::tidy::bugprone::PP.

◆ storeOptions()

void clang::tidy::bugprone::LambdaFunctionNameCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

Definition at line 69 of file LambdaFunctionNameCheck.cpp.


The documentation for this class was generated from the following files: