Open
Description
C++23 suggests us #elifdef
and #elifndef
as a new way to write directives in a long conditional preprocessing block.
Needs a check that will find usages of #elif
followed by defined identifier
(or !defined identifier
) and will suggest to change it to #elifdef identifier
(or #elifndef identifier
).
BEFORE:
#ifdef CPU
std::cout << "4: no1\n";
#elif defined GPU
std::cout << "4: no2\n";
#elif !defined RAM
std::cout << "4: yes\n";
#endif
AFTER:
#ifdef CPU
std::cout << "4: no1\n";
#elifdef GPU
std::cout << "4: no2\n";
#elifndef RAM
std::cout << "4: yes\n";
#endif