tidy - readability-use-concise-preprocessor-directives — Extra Clang Tools 22.0.0git documentation (original) (raw)

readability-use-concise-preprocessor-directives

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 #elifdefor #elifndef:

#if defined(MEOW) #if !defined(MEOW)

// becomes

#ifdef MEOW #ifndef MEOW

Since C23 and C++23:

#elif defined(MEOW) #elif !defined(MEOW)

// becomes

#elifdef MEOW #elifndef MEOW