[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


================
@@ -10848,6 +10848,21 @@ TEST_F(FormatTest, WrapsTemplateDeclarations) {
                "public:\n"
                "  E *f();\n"
                "};");
+  AlwaysBreak.RequiresClausePosition = FormatStyle::RCPS_SingleLine;
+  verifyNoChange("template <typename T> requires std::floating_point<T>\n"
+                 "using LerpValue = ClampedValue<T, T{0}, T{1}>;",
+                 AlwaysBreak);
+  AlwaysBreak.RequiresClausePosition = FormatStyle::RCPS_WithPreceding;
+  verifyNoChange("template <typename T> requires std::floating_point<T>\n"
----------------
owenca wrote:

Ditto.

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


More information about the cfe-commits mailing list