clang-tools 22.0.0git
clang::tidy::readability::MisleadingIndentationCheck Class Reference

Checks the code for dangling else, and possible misleading indentations due to missing braces. More...

#include <MisleadingIndentationCheck.h>

Inheritance diagram for clang::tidy::readability::MisleadingIndentationCheck:
[legend]

Public Member Functions

 MisleadingIndentationCheck (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
std::optional< TraversalKind > getCheckTraversalKind () const override

Detailed Description

Checks the code for dangling else, and possible misleading indentations due to missing braces.

Note that this check only works as expected when the tabs or spaces are used consistently and not mixed.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/readability/misleading-indentation.html

Definition at line 22 of file MisleadingIndentationCheck.h.

Constructor & Destructor Documentation

◆ MisleadingIndentationCheck()

clang::tidy::readability::MisleadingIndentationCheck::MisleadingIndentationCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 24 of file MisleadingIndentationCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::readability::MisleadingIndentationCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 130 of file MisleadingIndentationCheck.cpp.

◆ getCheckTraversalKind()

std::optional< TraversalKind > clang::tidy::readability::MisleadingIndentationCheck::getCheckTraversalKind ( ) const
inlineoverride

Definition at line 28 of file MisleadingIndentationCheck.h.

◆ registerMatchers()

void clang::tidy::readability::MisleadingIndentationCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 121 of file MisleadingIndentationCheck.cpp.


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