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

Catches assignments within the condition clause of an if statement. More...

#include <AssignmentInIfConditionCheck.h>

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

Public Member Functions

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

Detailed Description

Catches assignments within the condition clause of an if statement.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html

Definition at line 20 of file AssignmentInIfConditionCheck.h.

Constructor & Destructor Documentation

◆ AssignmentInIfConditionCheck()

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

Definition at line 22 of file AssignmentInIfConditionCheck.h.

Referenced by check().

Member Function Documentation

◆ check()

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

Definition at line 22 of file AssignmentInIfConditionCheck.cpp.

References AssignmentInIfConditionCheck(), and report().

◆ registerMatchers()

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

Definition at line 18 of file AssignmentInIfConditionCheck.cpp.

◆ report()

void clang::tidy::bugprone::AssignmentInIfConditionCheck::report ( const Expr * AssignmentExpr)

Definition at line 68 of file AssignmentInIfConditionCheck.cpp.

Referenced by check().


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