[libcxx-commits] [libcxx] [libc++] fix no-localisation ci failure on <complex> (PR #145213)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 22 10:53:21 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Hui (huixie90)

<details>
<summary>Changes</summary>

There are lots of errors in the CI no-localisation build

```
# .---command stderr------------
# | While building module 'std' imported from /__w/llvm-project/llvm-project/build/generic-no-localization/libcxx/test/libcxx/double_include.gen.py/csignal.sh.cpp:10:
# | In file included from <module-includes>:309:
# | /__w/llvm-project/llvm-project/build/generic-no-localization/libcxx/test-suite-install/include/c++/v1/complex:381:13: error: declaration of 'size_t' must be imported from module 'std_core.cstddef.size_t' before it is required
# |   381 |   template <size_t _Ip, class _Xp>
# |       |             ^
# | /__w/llvm-project/llvm-project/build/generic-no-localization/libcxx/test-suite-install/include/c++/v1/__cstddef/size_t.h:20:7: note: declaration here is not visible
# |    20 | using size_t = decltype(sizeof(int));
# |       |       ^
# | /__w/llvm-project/llvm-project/build/generic-no-localization/libcxx/test/libcxx/double_include.gen.py/csignal.sh.cpp:10:10: fatal error: could not build module 'std'
# |    10 | #include <csignal>
# |       |  ~~~~~~~~^
# | 2 errors generated.
```

---
Full diff: https://github.com/llvm/llvm-project/pull/145213.diff


3 Files Affected:

- (modified) libcxx/include/complex (+1) 
- (modified) libcxx/test/std/numerics/complex.number/complex.tuple/tuple_element.compile.pass.cpp (+1-1) 
- (modified) libcxx/test/std/numerics/complex.number/complex.tuple/tuple_size.compile.pass.cpp (+1-1) 


``````````diff
diff --git a/libcxx/include/complex b/libcxx/include/complex
index e9baec04d9465..d8ec3d95c10ed 100644
--- a/libcxx/include/complex
+++ b/libcxx/include/complex
@@ -260,6 +260,7 @@ template<class T> complex<T> tanh (const complex<T>&);
 #  include <__cxx03/complex>
 #else
 #  include <__config>
+#  include <__cstddef/size_t.h>
 #  include <__fwd/complex.h>
 #  include <__fwd/tuple.h>
 #  include <__tuple/tuple_element.h>
diff --git a/libcxx/test/std/numerics/complex.number/complex.tuple/tuple_element.compile.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.tuple/tuple_element.compile.pass.cpp
index 50c0e0eff1eda..3a220578a074c 100644
--- a/libcxx/test/std/numerics/complex.number/complex.tuple/tuple_element.compile.pass.cpp
+++ b/libcxx/test/std/numerics/complex.number/complex.tuple/tuple_element.compile.pass.cpp
@@ -16,7 +16,7 @@
 #include <complex>
 #include <concepts>
 
-template <size_t I, typename C>
+template <std::size_t I, typename C>
 concept HasTupleElement = requires { std::tuple_element<I, C>{}; };
 
 struct SomeObject {};
diff --git a/libcxx/test/std/numerics/complex.number/complex.tuple/tuple_size.compile.pass.cpp b/libcxx/test/std/numerics/complex.number/complex.tuple/tuple_size.compile.pass.cpp
index 28dcbe3fc5ecd..1091c6345598e 100644
--- a/libcxx/test/std/numerics/complex.number/complex.tuple/tuple_size.compile.pass.cpp
+++ b/libcxx/test/std/numerics/complex.number/complex.tuple/tuple_size.compile.pass.cpp
@@ -28,7 +28,7 @@ void test() {
   using C = std::complex<T>;
 
   static_assert(HasTupleSize<C>);
-  static_assert(std::same_as<typename std::tuple_size<C>::value_type, size_t>);
+  static_assert(std::same_as<typename std::tuple_size<C>::value_type, std::size_t>);
   static_assert(std::tuple_size<C>() == 2);
 }
 

``````````

</details>


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


More information about the libcxx-commits mailing list