[clang] [clang-format] Adjust requires clause wrapping (#101550) (PR #102078)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 08:13:28 PDT 2024


================
@@ -25831,19 +25843,108 @@ TEST_F(FormatTest, RequiresClausesPositions) {
 
   verifyFormat("template <typename T>\n"
                "int S::bar(T t) &&\n"
-               "requires F<T> {\n"
+               "requires F<T>\n"
+               "{\n"
                "  return 5;\n"
                "}",
                Style);
 
   verifyFormat("template <typename T>\n"
                "int bar(T t)\n"
-               "requires F<T> {\n"
+               "requires F<T>\n"
+               "{\n"
                "  return 5;\n"
                "}",
                Style);
 
+  Style.RequiresClausePosition = FormatStyle::RCPS_OwnLineWithBrace;
+  Style.IndentRequiresClause = true;
----------------
HazardyKnusperkeks wrote:

While we're at it. Please update the documentation of `IndentRequiresClause`.

https://github.com/llvm/llvm-project/pull/102078


More information about the cfe-commits mailing list