Issue 87814
Summary [clang-format] [BUG] IndentPPDirectives is inconsistent
Labels clang-format
Assignees
Reporter Volker-Weissmann
    If I format the following code with `clang-format --style='{IndentPPDirectives: AfterHash}' main.c`
```c
int a;

#if FOO
#define BAR
#endif

#ifndef ABC 
#define ABC 123
#endif
```
it does not change. If however I add for example `int b;` after `int a;`, it gets formatted like this:
```c
int a;
int b;

#if FOO
# define BAR
#endif

#ifndef ABC
#  define ABC 123
#endif
```

This definitely seems like a bug to me, the 2nd snippet is correct and the 1st snippet is wrong.
If you want me to, I can work on a PR that would fix the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to