Issue 127470
Summary clang-format regression around class declarations with attributes
Labels clang-format
Assignees owenca
Reporter kadircet
    desired formatting:
```cpp
#define ABSL_ATTRIBUTE_TRIVIAL_ABI
#define ABSL_NULLABILITY_COMPATIBLE

class ABSL_ATTRIBUTE_TRIVIAL_ABI ABSL_NULLABILITY_COMPATIBLE
    ArenaSafeUniquePtr{};
```

actual formatting:
```cpp
#define ABSL_ATTRIBUTE_TRIVIAL_ABI
#define ABSL_NULLABILITY_COMPATIBLE

class ABSL_ATTRIBUTE_TRIVIAL_ABI
 ABSL_NULLABILITY_COMPATIBLE ArenaSafeUniquePtr {};
```

bisection points to https://github.com/llvm/llvm-project/pull/124891. it's similar to https://github.com/llvm/llvm-project/issues/124574 as we were putting class-name to its own line and now we're mixing it with attributes. I guess this is due to special casing `ClassHeadName` despite having a heuristic with false positives that determines it (e.g. in this case we're falsely treating `ABSL_ATTRIBUTE_TRIVIAL_ABI` as `ClassHeadName`).
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to