public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc/devel/ranger] libstdc++: Fix two tests that fail in C++20 mode Date: Wed, 17 Jun 2020 20:02:07 +0000 (GMT) [thread overview] Message-ID: <20200617200207.3A61F3982C75@sourceware.org> (raw) https://gcc.gnu.org/g:f6b2b79040dea3cac4eb77684c4dbe12927f0b9c commit f6b2b79040dea3cac4eb77684c4dbe12927f0b9c Author: Jonathan Wakely <jwakely@redhat.com> Date: Sat Mar 28 21:52:13 2020 +0000 libstdc++: Fix two tests that fail in C++20 mode * testsuite/20_util/is_constructible/value-2.cc: Fix test to account for changes due to parenthesized aggregate-initialization in C++20. * testsuite/20_util/time_point/cons/81468.cc: Fix test to not clash with std::chrono::sys_time in C++20. Diff: --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc | 4 ++++ libstdc++-v3/testsuite/20_util/time_point/cons/81468.cc | 8 +++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a016f640df3..912bab28691 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2020-03-28 Jonathan Wakely <jwakely@redhat.com> + * testsuite/20_util/is_constructible/value-2.cc: Fix test to account + for changes due to parenthesized aggregate-initialization in C++20. + * testsuite/20_util/time_point/cons/81468.cc: Fix test to not clash + with std::chrono::sys_time in C++20. + * include/bits/stl_iterator.h (reverse_iterator): Use requires-clause to constrain C++20 versions of comparison operators. Fix backwards logic of relational operators. diff --git a/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc b/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc index c73cab8c02b..c54b749c046 100644 --- a/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc +++ b/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc @@ -107,7 +107,9 @@ static_assert(!std::is_constructible<Abstract, std::nullptr_t>::value, "Error"); static_assert(!std::is_constructible<std::nullptr_t, Abstract>::value, "Error"); static_assert(!std::is_constructible<Abstract, int[]>::value, "Error"); static_assert(std::is_constructible<B, D>::value, "Error"); +#ifndef __cpp_aggregate_paren_init static_assert(!std::is_constructible<D, B>::value, "Error"); +#endif static_assert(!std::is_constructible<int[], int[1]>::value, "Error"); static_assert(!std::is_constructible<int[1], int[]>::value, "Error"); static_assert(!std::is_constructible<int[], Empty>::value, "Error"); @@ -416,7 +418,9 @@ static_assert(!std::is_constructible<int(&)[1], int(&)[2]>::value, "Error"); static_assert(!std::is_constructible<int(&)[1], int&>::value, "Error"); static_assert(!std::is_constructible<int&, int(&)[1]>::value, "Error"); +#ifndef __cpp_aggregate_paren_init static_assert(!std::is_constructible<U, int>::value, "Error"); +#endif static_assert(!std::is_constructible<U, Empty>::value, "Error"); static_assert(!std::is_constructible<void(), void()>::value, "Error"); diff --git a/libstdc++-v3/testsuite/20_util/time_point/cons/81468.cc b/libstdc++-v3/testsuite/20_util/time_point/cons/81468.cc index 6f3e920d789..99ded478d3f 100644 --- a/libstdc++-v3/testsuite/20_util/time_point/cons/81468.cc +++ b/libstdc++-v3/testsuite/20_util/time_point/cons/81468.cc @@ -20,11 +20,13 @@ #include <chrono> #include <type_traits> -using namespace std; -using namespace std::chrono; +using std::is_constructible; +using std::chrono::seconds; +using std::chrono::milliseconds; template <class Duration> - using sys_time = time_point<system_clock, Duration>; + using sys_time + = std::chrono::time_point<std::chrono::system_clock, Duration>; static_assert(is_constructible<sys_time<milliseconds>, sys_time<seconds>>{}, "Can construct time_point from one with lower precision duration");
reply other threads:[~2020-06-17 20:02 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200617200207.3A61F3982C75@sourceware.org \ --to=aldyh@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).