Issue 132561
Summary [clang-tidy] Check request: modernize-use-elifdef-and-elifndef
Labels clang-tidy
Assignees
Reporter denzor200
    
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
```

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to