Issue 123382
Summary Forced line-break in pre-processor statements
Labels new issue
Assignees
Reporter tl-photography
    Lets assume we have this PP directive:

```c
#if ((CONDITION_A_SWITCH == ENABLED) || (CONDITION_A_SWITCH == ENABLED) || (CONDITION_A_SWITCH == ENABLED))
[...]
#endif
```

It would be nice to configure clang-format in a way that I would format this like:

```c
#if (   (CONDITION_A_SWITCH == ENABLED) \
     || (CONDITION_A_SWITCH == ENABLED) \
     || (CONDITION_A_SWITCH == ENABLED) )
[...]
#endif
```

The advantage of this would be that when SCM is used and lines would be added or removed, less or at least easier conflicts would occur.

In a large code base with a lot of feature switches, this would be very helpful.

I have checked the code if I could file a PR myself, but tbh I didn't find a place to start.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to