clang-tools 24.0.0git
clang::tidy::readability::RedundantZeroInitializerCheck Class Reference

Finds explicit zero initializers of arrays that can be replaced with empty braces, e.g. More...

#include <RedundantZeroInitializerCheck.h>

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

Public Member Functions

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

Detailed Description

Finds explicit zero initializers of arrays that can be replaced with empty braces, e.g.

char a[12] = {0}; becomes char a[12] = {};.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-zero-initializer.html

Definition at line 21 of file RedundantZeroInitializerCheck.h.

Constructor & Destructor Documentation

◆ RedundantZeroInitializerCheck()

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

Definition at line 23 of file RedundantZeroInitializerCheck.h.

Member Function Documentation

◆ check()

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

Definition at line 56 of file RedundantZeroInitializerCheck.cpp.

◆ getCheckTraversalKind()

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

Definition at line 31 of file RedundantZeroInitializerCheck.h.

◆ isLanguageVersionSupported()

bool clang::tidy::readability::RedundantZeroInitializerCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 27 of file RedundantZeroInitializerCheck.h.

◆ registerMatchers()

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

Definition at line 44 of file RedundantZeroInitializerCheck.cpp.


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