Issue 161848
Summary [clang-format] Allow excluding preproccesor directives from `IntegerLiteralSeparator`
Labels clang-format
Assignees
Reporter Alunderin
    Given the config

```yaml
IntegerLiteralSeparator:
    Decimal: 3
    DecimalMinDigits:       5
```

all numbers, *including numbers inside of preprocessor directives*, will have separators inserted:

```cpp
#if __cpp_constexpr >= 201'603L  // i.e 2016-03
```

I believe that there is a legitimate use-case for wanting directives to be left as-is, e.g. for feature testing (like above) or if someone wanted to use a C99 preprocessor for their C23/C++14 code.

---

I was thinking the option for it could look something like this:

```yaml
IntegerLiteralSeparator:
    Decimal:                3
 DecimalMinDigits:       5
    PPDirectives:           true
```

One could also consider something more fine-grained like `Always`/`Never`/`Leave`, although I can't imagine that being very beneficial.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to