[libcxx-commits] [PATCH] D129441: [libc++] Update clang-format style.

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 10 19:08:39 PDT 2022


philnik requested changes to this revision.
philnik added a comment.
This revision now requires changes to proceed.

(Apparently `Ctrl` + `Enter` is sending a message, who knew.)
My main concern with this is that I think there should be more changes made to the clang-format. I think we should put all the changes we want to make right now into a single PR. I don't know if you have had any more problems with the clang-format until know, but I know I had. I propose to change `PenaltyIndentedWhitespace` to two. I've tried it in a couple of PRs and that fixes the problem that clang-format produces weird code like

  template <
      class _Type,
      class _Alloc,
      class... _Args,
      class = __enable_if_t<!is_same_v<
          decltype(std::__uses_allocator_construction_args_impl<_Type>(
              std::declval<const _Alloc&>(), std::declval<_Args>()...)),
          void>>>

and changes the code to

  template <class _Type,
            class _Alloc,
            class... _Args,
            class = __enable_if_t<!is_same_v<decltype(std::__uses_allocator_construction_args_impl<_Type>(
                                                 std::declval<const _Alloc&>(), std::declval<_Args>()...)),
                                             void>>>

which is much better IMO. Putting it lower than two produces declarations where the parameters are almost all the way to the left, which I think isn't what we want either.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129441



More information about the libcxx-commits mailing list