From: H.J. Lu Date: Thu, 12 Dec 2024 21:31:05 +0000 (+0800) Subject: tst-assert-c++.cc: Return EXIT_UNSUPPORTED for GCC 4.9 or older X-Git-Tag: glibc-2.41~363 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e17b4c983748e7938aef90c90d417e1ca739e20;p=thirdparty%2Fglibc.git tst-assert-c++.cc: Return EXIT_UNSUPPORTED for GCC 4.9 or older Since assert/tst-assert-c++.cc fails to compile with GCC 4.9: ./tst-assert-c++.cc: In function ‘constexpr int check_constexpr()’: ./tst-assert-c++.cc:30:1: error: body of constexpr function ‘constexpr int check_constexpr()’ not a return-statement } ^ return EXIT_UNSUPPORTED for GCC 4.9 or older. Signed-off-by: H.J. Lu Reviewed-by: Sam James --- diff --git a/assert/tst-assert-c++.cc b/assert/tst-assert-c++.cc index 9d587a16fa..8f06ff8223 100644 --- a/assert/tst-assert-c++.cc +++ b/assert/tst-assert-c++.cc @@ -21,6 +21,7 @@ #undef NDEBUG #include +#if __GNUC_PREREQ (5, 0) /* The C++ standard requires that if the assert argument is a constant subexpression, then the assert itself is one, too. */ constexpr int @@ -77,5 +78,14 @@ do_test () return 0; } +#else +#include + +static int +do_test () +{ + return EXIT_UNSUPPORTED; +} +#endif #include