[libcxx-commits] [libcxx] Formatting Ranges: Range "m" specifier do not pass through to underlying element (PR #70616)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Oct 29 22:51:09 PDT 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 22043643c64f748cb00ae92476f2085b3c0903c9 5bdf2c2c7961881ece04a1b943d3331c566f2ec4 -- libcxx/include/__format/range_formatter.h libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/__format/range_formatter.h b/libcxx/include/__format/range_formatter.h
index d58742332..76bd9ca54 100644
--- a/libcxx/include/__format/range_formatter.h
+++ b/libcxx/include/__format/range_formatter.h
@@ -89,10 +89,10 @@ struct _LIBCPP_TEMPLATE_VIS range_formatter {
 
     // Add "m" specifier semantics if there are no underlying specifier
     if (!__has_range_underlying_spec && __has_m_specifier) {
-        if constexpr (__fmt_pair_like<_Tp>) { // should always be true
-            __underlying_.set_brackets({}, {});
-            __underlying_.set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ": "));
-        }
+      if constexpr (__fmt_pair_like<_Tp>) { // should always be true
+        __underlying_.set_brackets({}, {});
+        __underlying_.set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ": "));
+      }
     }
 
     // This test should not be required if __has_range_underlying_spec is false.

``````````

</details>


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


More information about the libcxx-commits mailing list