[clang] [clang-format] Fix for BreakTemplateDeclarations and RequiresClausePosition (PR #159277)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 20 01:44:20 PDT 2025


================
@@ -10937,13 +10952,12 @@ TEST_F(FormatTest, WrapsTemplateDeclarations) {
                Style);
 
   Style.RequiresClausePosition = FormatStyle::RCPS_WithPreceding;
-  verifyNoChange("template <auto x>\n"
-                 "requires(x > 1)\n"
-                 "constexpr int with_req(int) {\n"
-                 "  return 1;\n"
-                 "}",
-                 Style);
   verifyFormat("template <auto x> requires(x > 1)\n"
+               "constexpr int with_req(int) {\n"
+               "  return 1;\n"
+               "}",
+               "template <auto x>"
+               "requires(x > 1)\n"
                "constexpr int with_req(int) {\n"
                "  return 1;\n"
                "}",
----------------
owenca wrote:

Delete. In general, we prefer `verifyFormat(Code, Style)` as it "messes" up the input.

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


More information about the cfe-commits mailing list