From 562416d8131dc9eeb4a778e7ef476157dbd9afd2 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 17 Mar 2025 15:02:12 +0000 Subject: [PATCH] libstdc++: Make test use instead of Our ensures that LLONG_MIN, LLONG_MAX, and ULLONG_MAX are defined even if the C library's doesn't define them. Our then includes , which should mean that and always define the same macros. However, we only install our own version of for --enable-cheaders=c and not for the default --enable-cheaders=c_global setting that everybody uses. This means that if the C library's is not C++-aware, or if the C library doesn't provide it and GCC's own gcc/glimits.h is used instead, then defines the macros for long long types but does not. This causes the new 20_util/stdbit/1.cc test to fail for arm-non-eabi because it uses gcc/glimits.h which is not C++-aware, only checking __STDC_VERSION__ when deciding whether to declare the long long macros. If gcc/glimits.h also checked __cplusplus it would be OK, and we would not need our own to be installed. This commit just changes the new test to use instead of , but we should ensure that gcc/glimits.h is made to work (i.e. define the long long macros) for C++, and/or install our own for the --enable-cheaders=c_global configuration. libstdc++-v3/ChangeLog: * testsuite/20_util/stdbit/1.cc: Include instead of . --- libstdc++-v3/testsuite/20_util/stdbit/1.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/20_util/stdbit/1.cc b/libstdc++-v3/testsuite/20_util/stdbit/1.cc index c9f2b599d0d..304b3257d60 100644 --- a/libstdc++-v3/testsuite/20_util/stdbit/1.cc +++ b/libstdc++-v3/testsuite/20_util/stdbit/1.cc @@ -16,7 +16,7 @@ #endif #include -#include +#include void test_leading_zeros() -- 2.47.2