[llvm] [clang-tools-extra] [clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71935)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 19:23:49 PST 2023


gulfemsavrun wrote:

We started seeing some inconsistent behavior in `maybe_unused` attributes after this change:

**Input:** 
```
struct S {
  [[maybe_unused]] static constexpr uint32_t kMax1 = 4294967295;
  [[maybe_unused]]
  static constexpr uint32_t kMax2 = 4294967295;
};
```

**Clang-format invocation:**
```
clang-format "--style={BasedOnStyle: google, ColumnLimit: 0}" <src
```

**Output:**
```
struct S {
  [[maybe_unused]] static constexpr uint32_t kMax1 = 4294967295;
  [[maybe_unused]]
  static constexpr uint32_t kMax2 = 4294967295;
};
```

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


More information about the cfe-commits mailing list