diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2024-12-13 05:31:05 +0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2024-12-14 19:27:45 +0800 |
commit | 5e17b4c983748e7938aef90c90d417e1ca739e20 (patch) | |
tree | 972d30eebe40b0759fbb21dec918d363ee49a970 | |
parent | 8aa2a9e0339215012354f3c4a262edda838134e8 (diff) | |
download | glibc-5e17b4c983748e7938aef90c90d417e1ca739e20.zip glibc-5e17b4c983748e7938aef90c90d417e1ca739e20.tar.gz glibc-5e17b4c983748e7938aef90c90d417e1ca739e20.tar.bz2 |
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 <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
-rw-r--r-- | assert/tst-assert-c++.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/assert/tst-assert-c++.cc b/assert/tst-assert-c++.cc index 9d587a1..8f06ff8 100644 --- a/assert/tst-assert-c++.cc +++ b/assert/tst-assert-c++.cc @@ -21,6 +21,7 @@ #undef NDEBUG #include <assert.h> +#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 <support/test-driver.h> + +static int +do_test () +{ + return EXIT_UNSUPPORTED; +} +#endif #include <support/test-driver.c> |