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

Finds uses of #if that can be simplified to #ifdef or #ifndef / and, since C23 and C++23, uses of #elif that can be simplified to / #elifdef or #elifndef. More...

#include <UseConcisePreprocessorDirectivesCheck.h>

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

Public Member Functions

void registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override

Detailed Description

Finds uses of #if that can be simplified to #ifdef or #ifndef / and, since C23 and C++23, uses of #elif that can be simplified to / #elifdef or #elifndef.

User-facing documentation:
https://clang.llvm.org/extra/clang-tidy/checks/readability/use-concise-preprocessor-directives.html 

Definition at line 22 of file UseConcisePreprocessorDirectivesCheck.h.

Member Function Documentation

◆ isLanguageVersionSupported()

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

Definition at line 27 of file UseConcisePreprocessorDirectivesCheck.h.

◆ registerPPCallbacks()

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

Definition at line 105 of file UseConcisePreprocessorDirectivesCheck.cpp.


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