Issue 55457
Summary clang-format gets confused by attributes on enum classes
Labels new issue
Assignees
Reporter bsilver8192
    This:
```c++
enum class [[nodiscard]] C2 {
  // a comment
  A,
  // a comment
  B
};
```
turns into this:
```c++
enum class [[nodiscard]] C2{// a comment
                            A,
                            // a comment
                            B};
```

Also, this:
```c++
enum class [[nodiscard]] X2 {
  A,
  B,
};
```
turns into this:
```c++
enum class [[nodiscard]] X2{
    A,
    B,
};
```

The same `enum class`es without the `[[nodiscard]]` just get reindented to 4 spaces and are otherwise left as-is like I expect.

Tested with clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04 with all default formatting options.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to