mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
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>
This commit is contained in:
parent
8aa2a9e033
commit
5e17b4c983
1 changed files with 10 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#if __GNUC_PREREQ (5, 0)
|
||||||
/* The C++ standard requires that if the assert argument is a constant
|
/* The C++ standard requires that if the assert argument is a constant
|
||||||
subexpression, then the assert itself is one, too. */
|
subexpression, then the assert itself is one, too. */
|
||||||
constexpr int
|
constexpr int
|
||||||
|
@ -77,5 +78,14 @@ do_test ()
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#include <support/test-driver.h>
|
||||||
|
|
||||||
|
static int
|
||||||
|
do_test ()
|
||||||
|
{
|
||||||
|
return EXIT_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <support/test-driver.c>
|
#include <support/test-driver.c>
|
||||||
|
|
Loading…
Add table
Reference in a new issue