clang-tidy - readability-use-concise-preprocessor-directives — Extra Clang Tools 22.1.3 documentation

# Extra Clang Tools 22.1.3 documentation

## clang-tidy - readability-use-concise-preprocessor-directives

# 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 `#elifdef` or `#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