[all-commits] [llvm/llvm-project] 497b2e: [clang-format] Change LLVM style to BreakAfterAttr...
Vlad Serebrennikov via All-commits
all-commits at lists.llvm.org
Sat Oct 28 05:02:18 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 497b2ebb9edcfd5315586b796f47589e9820b4b9
https://github.com/llvm/llvm-project/commit/497b2ebb9edcfd5315586b796f47589e9820b4b9
Author: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: 2023-10-28 (Sat, 28 Oct 2023)
Changed paths:
M clang/docs/ReleaseNotes.rst
M clang/lib/Format/Format.cpp
M clang/unittests/Format/FormatTest.cpp
Log Message:
-----------
[clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (#70360)
This patch addresses some examples of bad formatting in Clang. The following commit contains only changes suggested by clang-format: https://github.com/llvm/llvm-project/pull/70349/commits/21689b56d1fc1db0b2263e8049ff656d3757ad36.
I believe it's a net negative on readability, with a couple of particularly bad cases. Highlights:
```diff
- [[clang::preferred_type(bool)]]
- mutable unsigned CachedLocalOrUnnamed : 1;
+ [[clang::preferred_type(bool)]] mutable unsigned CachedLocalOrUnnamed : 1;
```
```diff
- [[clang::preferred_type(TypeDependence)]]
- unsigned Dependence : llvm::BitWidth<TypeDependence>;
+ [[clang::preferred_type(TypeDependence)]] unsigned Dependence
+ : llvm::BitWidth<TypeDependence>;
```
```diff
- [[clang::preferred_type(ExceptionSpecificationType)]]
- unsigned ExceptionSpecType : 4;
+ [[clang::preferred_type(
+ ExceptionSpecificationType)]] unsigned ExceptionSpecType : 4;
```
Style guides doesn't appear to have an opinion on this matter.
More information about the All-commits
mailing list