1 .. title:: clang-tidy - readability-redundant-preprocessor
3 readability-redundant-preprocessor
4 ==================================
6 Finds potentially redundant preprocessor directives. At the moment the
7 following cases are detected:
9 * `#ifdef` .. `#endif` pairs which are nested inside an outer pair with the
10 same condition. For example:
15 #ifdef FOO // inner ifdef is considered redundant
20 * Same for `#ifndef` .. `#endif` pairs. For example:
25 #ifndef FOO // inner ifndef is considered redundant
30 * `#ifndef` inside an `#ifdef` with the same condition:
35 #ifndef FOO // inner ifndef is considered redundant
40 * `#ifdef` inside an `#ifndef` with the same condition:
45 #ifdef FOO // inner ifdef is considered redundant
50 * `#if` .. `#endif` pairs which are nested inside an outer pair with the same
51 condition. For example:
57 #if FOO == 4 // inner if is considered redundant