[clang] [clang-format] Fix bad comment indentation before ifdef after braceless if (PR #94776)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 9 14:20:30 PDT 2024


owenca wrote:

This patch formats
```
void f() {
  if (foo)
    bar(); // Comment
#if BAZ
  baz();
#endif
}
```
to
```
void f() {
  if (foo)
    bar();
        // Comment
#if BAZ
  baz();
#endif
}
```
The trailing comment shouldn't be wrapped.

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


More information about the cfe-commits mailing list