Some c++23 tests fail on targets that don't satisfy dg-require-cmath, because referenced math functions don't get declared in std. Add the missing requirement.
Regstrapping on x86_64-linux-gnu. Already successfully tested with gcc-13 on aarch64-rtems, where it avoids the errors that come up because math.h doesn't meet the cmath requirements there. Ok to install? for libstdc++-v3/ChangeLog * testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc: Require cmath. * testsuite/26_numerics/headers/cmath/functions_std_c++23.cc: Likewise. * testsuite/26_numerics/headers/cmath/nextafter_std_c++23.cc: Likewise. --- .../headers/cmath/constexpr_std_c++23.cc | 1 + .../headers/cmath/functions_std_c++23.cc | 1 + .../26_numerics/headers/cmath/nextafter_c++23.cc | 1 + 3 files changed, 3 insertions(+) diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc index 0e3d112fe2e80..3c2377fd6987b 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/constexpr_std_c++23.cc @@ -16,6 +16,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do link { target c++23 } } +// { dg-require-cmath "" } #include <stdfloat> #include <cmath> diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++23.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++23.cc index 000cebf364aaa..ea68ac5da7551 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++23.cc +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++23.cc @@ -16,6 +16,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do link { target c++23 } } +// { dg-require-cmath "" } #include <stdfloat> #include <cmath> diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/nextafter_c++23.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/nextafter_c++23.cc index 7d7e10bd8aea3..91767d22cc3f2 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/nextafter_c++23.cc +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/nextafter_c++23.cc @@ -16,6 +16,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do run { target c++23 } } +// { dg-require-cmath "" } #include <stdfloat> #include <cmath> -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer More tolerance and less prejudice are key for inclusion and diversity Excluding neuro-others for not behaving ""normal"" is *not* inclusive