diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-10-24 15:13:56 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-10-24 15:13:56 +0100 |
commit | d5e4044f203db0d0b8c94270152946cbd1ed6738 (patch) | |
tree | 5b02122880ab49fcfb3f5cc5a4e243d1bd58d655 /libstdc++-v3 | |
parent | a506877462aa7ea64addc52af6bc1deca9e92f21 (diff) | |
download | gcc-d5e4044f203db0d0b8c94270152946cbd1ed6738.zip gcc-d5e4044f203db0d0b8c94270152946cbd1ed6738.tar.gz gcc-d5e4044f203db0d0b8c94270152946cbd1ed6738.tar.bz2 |
Fix tests that fail with -std=gnu++98 or -std=gnu++11
Backport from mainline
2019-06-06 Jonathan Wakely <jwakely@redhat.com>
* testsuite/20_util/is_nothrow_invocable/value.cc: Test converting to
void.
* testsuite/experimental/names.cc: Do not run for C++98 mode. Do not
include Library Fundamentals or Networking headers in C++11 mode.
* testsuite/ext/char8_t/atomic-1.cc: Do not run for C++98 mode.
From-SVN: r277402
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/is_nothrow_invocable/value.cc | 4 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/experimental/names.cc | 7 |
3 files changed, 18 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b185730..16f3f10 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,6 +1,14 @@ 2019-10-24 Jonathan Wakely <jwakely@redhat.com> Backport from mainline + 2019-06-06 Jonathan Wakely <jwakely@redhat.com> + + * testsuite/20_util/is_nothrow_invocable/value.cc: Test converting to + void. + * testsuite/experimental/names.cc: Do not run for C++98 mode. Do not + include Library Fundamentals or Networking headers in C++11 mode. + + Backport from mainline 2019-10-22 Jonathan Wakely <jwakely@redhat.com> * include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98. diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/value.cc index d745b99..7396df2 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/value.cc @@ -119,9 +119,11 @@ void test01() static_assert( ! is_nt_invocable_r< T, F >(), "call throws"); static_assert( ! is_nt_invocable_r< NT, F >(), "call throws"); static_assert( ! is_nt_invocable_r< Ex, F >(), "call throws"); + static_assert( ! is_nt_invocable_r< void, F >(), "call throws"); static_assert( ! is_nt_invocable_r< T, CF >(), "conversion throws"); static_assert( is_nt_invocable_r< NT, CF >(), "" ); static_assert( ! is_nt_invocable_r< Ex, CF >(), "conversion fails"); + static_assert( is_nt_invocable_r< void, CF >(), ""); static_assert( ! is_nt_invocable< F, int >(), "call throws"); static_assert( is_nt_invocable< F&, int >(), ""); @@ -140,12 +142,14 @@ void test01() static_assert( is_nt_invocable_r< char&, CF, int >(), ""); static_assert( is_nt_invocable_r< char&, CF&, int >(), ""); + static_assert( is_nt_invocable_r< void, CF&, int >(), ""); static_assert( ! is_nt_invocable_r< T, CF&, int >(), "conversion throws"); static_assert( is_nt_invocable_r< NT, CF&, int >(), ""); static_assert( ! is_nt_invocable_r< Ex, CF&, int >(), "conversion fails, would use explicit constructor"); + static_assert( is_nt_invocable_r< void, CF&, int >(), ""); static_assert( ! is_nt_invocable< F, int, int >(), "would call private member"); diff --git a/libstdc++-v3/testsuite/experimental/names.cc b/libstdc++-v3/testsuite/experimental/names.cc index 1d2e7c0..17c8f37 100644 --- a/libstdc++-v3/testsuite/experimental/names.cc +++ b/libstdc++-v3/testsuite/experimental/names.cc @@ -15,7 +15,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-do compile } +// { dg-do compile { target c++11 } } // Define macros for some common variables names that we must not use for // naming variables, parameters etc. in the library. @@ -25,6 +25,9 @@ #if __has_include(<experimental/filesystem>) # include <experimental/filesystem> #endif + +#if __cplusplus >= 201402L + // Library Fundamentals #include <experimental/algorithm> #include <experimental/any> @@ -55,3 +58,5 @@ #include <experimental/unordered_set> #include <experimental/utility> #include <experimental/vector> + +#endif // C++14 |