Skip to content

[libc++] fix no-localisation ci failure on <complex> #145213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

huixie90
Copy link
Member

@huixie90 huixie90 commented Jun 22, 2025

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.

@huixie90 huixie90 changed the title [libc++] try fix localisation ci [libc++] fix no-localisation ci failure on <complex> Jun 22, 2025
@huixie90 huixie90 marked this pull request as ready for review June 22, 2025 17:52
@huixie90 huixie90 requested a review from a team as a code owner June 22, 2025 17:52
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jun 22, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 22, 2025

@llvm/pr-subscribers-libcxx

Author: Hui (huixie90)

Changes

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 &lt;module-includes&gt;: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 &lt;size_t _Ip, class _Xp&gt;
# |       |             ^
# | /__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 &lt;csignal&gt;
# |       |  ~~~~~~~~^
# | 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 --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);
 }
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants