[clang-tools-extra] [clang-tidy] Add new check: `modernize-use-concise-preprocessor-directives` (PR #146830)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 5 03:14:12 PDT 2025


localspook wrote:

Maybe I'm misunderstanding, but are you concerned about
```cpp
#if defined(foo) && defined(bar)
```
being rewritten to this?
```cpp
#ifdef foo && if defined(bar)
```
It won't do that, that's not valid syntax (there's not really any way to rewrite it). I've added a test to ensure the check doesn't touch it.

https://github.com/llvm/llvm-project/pull/146830


More information about the cfe-commits mailing list