[libcxx-commits] [libcxx] [libc++] P1789R3: Library Support for Expansion Statements (PR #167184)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Nov 8 14:25:00 PST 2025


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 origin/main HEAD --extensions h,,cpp -- libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.pass.cpp libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.verify.cpp libcxx/include/__utility/integer_sequence.h libcxx/include/version libcxx/test/std/language.support/support.limits/support.limits.general/utility.version.compile.pass.cpp libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.pass.cpp b/libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.pass.cpp
index 8deda7741..7220bccb6 100644
--- a/libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.pass.cpp
+++ b/libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.pass.cpp
@@ -18,32 +18,31 @@
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    using empty  = std::integer_sequence<int>;
-    using size4  = std::integer_sequence<int, 9, 8, 7, 2>;
-
-    static_assert ( std::tuple_size_v<empty> == 0, "empty size wrong" );
-    static_assert ( std::tuple_size_v<const empty> == 0, "empty size wrong" );
-
-    static_assert ( std::tuple_size_v<size4> == 4, "size4 size wrong" );
-    static_assert ( std::tuple_size_v<const size4> == 4, "size4 size wrong" );
-
-    static_assert ( std::is_same_v<std::tuple_element_t<0, size4>, int>, "size4 type wrong" );
-    static_assert ( std::is_same_v<std::tuple_element_t<1, size4>, int>, "size4 type wrong" );
-    static_assert ( std::is_same_v<std::tuple_element_t<2, size4>, int>, "size4 type wrong" );
-    static_assert ( std::is_same_v<std::tuple_element_t<3, size4>, int>, "size4 type wrong" );
-
-    static_assert ( std::is_same_v<std::tuple_element_t<0, const size4>, int>, "const4 type wrong" );
-    static_assert ( std::is_same_v<std::tuple_element_t<1, const size4>, int>, "const4 type wrong" );
-    static_assert ( std::is_same_v<std::tuple_element_t<2, const size4>, int>, "const4 type wrong" );
-    static_assert ( std::is_same_v<std::tuple_element_t<3, const size4>, int>, "const4 type wrong" );
-
-    constexpr static size4 seq4{};
-    static_assert ( get<0> (seq4) == 9, "size4 element 0 wrong" );
-    static_assert ( get<1> (seq4) == 8, "size4 element 1 wrong" );
-    static_assert ( get<2> (seq4) == 7, "size4 element 2 wrong" );
-    static_assert ( get<3> (seq4) == 2, "size4 element 3 wrong" );
+int main(int, char**) {
+  using empty = std::integer_sequence<int>;
+  using size4 = std::integer_sequence<int, 9, 8, 7, 2>;
+
+  static_assert(std::tuple_size_v<empty> == 0, "empty size wrong");
+  static_assert(std::tuple_size_v<const empty> == 0, "empty size wrong");
+
+  static_assert(std::tuple_size_v<size4> == 4, "size4 size wrong");
+  static_assert(std::tuple_size_v<const size4> == 4, "size4 size wrong");
+
+  static_assert(std::is_same_v<std::tuple_element_t<0, size4>, int>, "size4 type wrong");
+  static_assert(std::is_same_v<std::tuple_element_t<1, size4>, int>, "size4 type wrong");
+  static_assert(std::is_same_v<std::tuple_element_t<2, size4>, int>, "size4 type wrong");
+  static_assert(std::is_same_v<std::tuple_element_t<3, size4>, int>, "size4 type wrong");
+
+  static_assert(std::is_same_v<std::tuple_element_t<0, const size4>, int>, "const4 type wrong");
+  static_assert(std::is_same_v<std::tuple_element_t<1, const size4>, int>, "const4 type wrong");
+  static_assert(std::is_same_v<std::tuple_element_t<2, const size4>, int>, "const4 type wrong");
+  static_assert(std::is_same_v<std::tuple_element_t<3, const size4>, int>, "const4 type wrong");
+
+  constexpr static size4 seq4{};
+  static_assert(get<0>(seq4) == 9, "size4 element 0 wrong");
+  static_assert(get<1>(seq4) == 8, "size4 element 1 wrong");
+  static_assert(get<2>(seq4) == 7, "size4 element 2 wrong");
+  static_assert(get<3>(seq4) == 2, "size4 element 3 wrong");
 
   return 0;
 }
diff --git a/libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.verify.cpp b/libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.verify.cpp
index 9c93d11b2..5863a692a 100644
--- a/libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.verify.cpp
+++ b/libcxx/test/std/utilities/intseq/intseq.binding/integer_seq.verify.cpp
@@ -14,11 +14,13 @@
 #include <utility>
 
 void f() {
-    using test1 = typename std::tuple_element<0, std::integer_sequence<int>>::type; // expected-error-re@*:* {{static assertion failed{{.*}}Index out of bounds in std::tuple_element<> (std::integer_sequence)}}
-    using test2 = typename std::tuple_element<0, const std::integer_sequence<int>>::type; // expected-error-re@*:* {{static assertion failed{{.*}}Index out of bounds in std::tuple_element<> (const std::integer_sequence)}}
+  using test1 = typename std::tuple_element<0, std::integer_sequence<int>>::
+      type; // expected-error-re@*:* {{static assertion failed{{.*}}Index out of bounds in std::tuple_element<> (std::integer_sequence)}}
+  using test2 = typename std::tuple_element<0, const std::integer_sequence<int>>::
+      type; // expected-error-re@*:* {{static assertion failed{{.*}}Index out of bounds in std::tuple_element<> (const std::integer_sequence)}}
 
-    auto empty = std::integer_sequence<int>();
-    // expected-error-re@*:* {{static assertion failed{{.*}}Index out of bounds in std::get<> (std::integer_sequence)}}
-    // expected-error-re@*:* {{invalid index 0 for pack '{{.*}}' of size 0}}
-    (void)std::get<0>(empty);
+  auto empty = std::integer_sequence<int>();
+  // expected-error-re@*:* {{static assertion failed{{.*}}Index out of bounds in std::get<> (std::integer_sequence)}}
+  // expected-error-re@*:* {{invalid index 0 for pack '{{.*}}' of size 0}}
+  (void)std::get<0>(empty);
 }

``````````

</details>


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


More information about the libcxx-commits mailing list