[libcxx-commits] [PATCH] D99691: [libcxx] adjusts formatting rules

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 31 16:50:29 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/.clang-format:5
 Language: Cpp
-Standard: Cpp03
+Standard: Cpp11
 
----------------
Actually, I'd turn this all the way up to Cpp20 or however high it goes. The only interesting thing controlled by this option AFAIK is whether clang-format will do
```
foo<bar<baz> > x;  // we must do this anywhere C++03-portability is required
```
or
```
foo<bar<baz>> x;  // we prefer this wherever possible
```
Either way, blindly applying clang-format to //actual// libc++ code is going to screw it up one way or the other. But given that you're the only person relying on clang-format to format your patches AFAIK, and you're working exclusively on C++20 code (never on C++03 code), I think it's totally reasonable to check in a style file that specifies `Cpp20`.


================
Comment at: libcxx/.clang-format:16
+BreakBeforeConceptDeclarations: true
+IndentRequires: false
 ---
----------------
Please set "IndentRequires" to true. Or at least, regardless of what tools you run locally to format your code, please ensure that what gets checked in looks like

```
template <class _Tp>
  requires foo<_Tp>
inline constexpr bar(_Tp) {
```
and not
```
template <class _Tp>
requires foo<_Tp>
inline constexpr bar(_Tp) {
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99691/new/

https://reviews.llvm.org/D99691



More information about the libcxx-commits mailing list