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

Detect multiple statement macros that are used in unbraced conditionals. More...

#include <MultipleStatementMacroCheck.h>

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

Public Member Functions

 MultipleStatementMacroCheck (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

Detect multiple statement macros that are used in unbraced conditionals.

Only the first statement of the macro will be inside the conditional and the other ones will be executed unconditionally.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/multiple-statement-macro.html

Definition at line 22 of file MultipleStatementMacroCheck.h.

Constructor & Destructor Documentation

◆ MultipleStatementMacroCheck()

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

Definition at line 24 of file MultipleStatementMacroCheck.h.

Member Function Documentation

◆ check()

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

Definition at line 65 of file MultipleStatementMacroCheck.cpp.

◆ registerMatchers()

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

Definition at line 56 of file MultipleStatementMacroCheck.cpp.


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