[PATCH] D113319: [clang-format] Improve require and concept handling

Mark de Wever via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 4 11:14:20 PST 2022


Mordante added a comment.

Thanks for working on this! I love to see better `requires` support in clang-format. I didn't do a real review, just some drive-by comments.



================
Comment at: clang/docs/ClangFormatStyleOptions.rst:3399
 
+**RequiresClausePositionForClasses** (``RequiresClausePositionStyle``) :versionbadge:`clang-format 14`
+  The position of the ``requires`` clause for class templates.
----------------
I assume that should `clang-format 15` now. Same for other new options.


================
Comment at: clang/lib/Format/Format.cpp:1212
   LLVMStyle.ReferenceAlignment = FormatStyle::RAS_Pointer;
+  // This is open for discussions! When will LLVM adapt C++20?
+  LLVMStyle.RequiresClausePositionForClasses = FormatStyle::RCPS_OwnLine;
----------------
Note the libc++ already uses C++20 code. We don't use clang-format officially, but I use it for new code. (Mainly the `std::format` related code.)


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

https://reviews.llvm.org/D113319



More information about the cfe-commits mailing list