Issue |
153448
|
Summary |
[clang-format] bit-field that has its size specified using a variable with `::` can be misformatted
|
Labels |
clang-format
|
Assignees |
|
Reporter |
joelhock
|
clang-format version 20.1.0 (https://github.com/llvm/llvm-project.git https://github.com/llvm/llvm-project/commit/24a30daaa559829ad079f2ff7f73eb4e18095f88) correctly formatted this code:
```
struct struct_with_constexpr {
static constexpr unsigned int i_am_a_constexpr_lengthhhhh = 2;
};
struct foo {
uint8_t i_am_a_bit_field_this_long
: struct_with_constexpr::i_am_a_constexpr_lengthhhhh;
};
```
whereas clang-format version 21.1.0-rc3 (https://github.com/llvm/llvm-project.git https://github.com/llvm/llvm-project/commit/6096d35ea93c75f648a253a00775b4d74915c819) misformats it, breaking on the `::`
```
struct struct_with_constexpr {
static constexpr unsigned int i_am_a_constexpr_lengthhhhh = 2;
};
struct foo {
uint8_t i_am_a_bit_field_this_long : struct_with_constexpr::
i_am_a_constexpr_lengthhhhh;
};
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs