public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: William Schmidt <wschmidt@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/users/wschmidt/heads/builtins3)] libstdc++: Adjust tests that give different results in C++20 Date: Tue, 18 Aug 2020 18:19:43 +0000 (GMT) [thread overview] Message-ID: <20200818181943.3AE323894C1A@sourceware.org> (raw) https://gcc.gnu.org/g:8e2592a88821511aa45c3325246f3b08a88fa063 commit 8e2592a88821511aa45c3325246f3b08a88fa063 Author: Jonathan Wakely <jwakely@redhat.com> Date: Fri Jul 31 17:51:00 2020 +0100 libstdc++: Adjust tests that give different results in C++20 libstdc++-v3/ChangeLog: * testsuite/20_util/is_aggregate/value.cc: Adjust for changes to definition of aggregates in C++20. * testsuite/20_util/optional/requirements.cc: Adjust for defaulted comparisons in C++20. Diff: --- libstdc++-v3/testsuite/20_util/is_aggregate/value.cc | 15 ++++++++++++--- libstdc++-v3/testsuite/20_util/optional/requirements.cc | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/is_aggregate/value.cc b/libstdc++-v3/testsuite/20_util/is_aggregate/value.cc index bef9dc4ca07..085eb557419 100644 --- a/libstdc++-v3/testsuite/20_util/is_aggregate/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_aggregate/value.cc @@ -45,8 +45,6 @@ void test01() UnionType>(true), ""); static_assert(test_category<is_aggregate, SLType>(true), ""); - static_assert(test_category<is_aggregate, - NoexceptMoveAssignClass>(true), ""); static_assert(test_category<is_aggregate, unsigned[3]>(true), ""); static_assert(test_category<is_aggregate, @@ -63,8 +61,13 @@ void test01() EnumType[]>(true), ""); static_assert(test_category<is_aggregate, EnumType[][2]>(true), ""); - pos<ClassType, UnionType, SLType, NoexceptMoveAssignClass, + pos<ClassType, UnionType, SLType, unsigned[3], unsigned[3][2], unsigned[], unsigned[][3]>(); +#if __cplusplus == 201703L + static_assert(test_category<is_aggregate, + NoexceptMoveAssignClass>(true), ""); + pos<NoexceptMoveAssignClass>(); +#endif // Negative tests. static_assert(test_category<is_aggregate, @@ -93,4 +96,10 @@ void test01() void>(false), ""); neg<AbstractClass, PolymorphicClass, ExplicitClass, char, unsigned, bool, float, double, void>(); +#if __cplusplus > 201703L + // In C++20 aggregates cannot have user-declared constructors. + static_assert(test_category<is_aggregate, + NoexceptMoveAssignClass>(false), ""); + neg<NoexceptMoveAssignClass>(); +#endif } diff --git a/libstdc++-v3/testsuite/20_util/optional/requirements.cc b/libstdc++-v3/testsuite/20_util/optional/requirements.cc index 560e6f7691f..d8d52ab5367 100644 --- a/libstdc++-v3/testsuite/20_util/optional/requirements.cc +++ b/libstdc++-v3/testsuite/20_util/optional/requirements.cc @@ -312,7 +312,10 @@ struct JustEq {}; bool operator==(const JustEq&, const JustEq&); static_assert(is_eq_comparable<optional<JustEq>>::value, ""); +#if __cplusplus == 201703L +// In C++20 operator!= can be synthesized from operator== static_assert(!is_neq_comparable<optional<JustEq>>::value, ""); +#endif static_assert(!is_lt_comparable<optional<JustEq>>::value, ""); static_assert(!is_gt_comparable<optional<JustEq>>::value, ""); static_assert(!is_le_comparable<optional<JustEq>>::value, "");
reply other threads:[~2020-08-18 18:19 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=20200818181943.3AE323894C1A@sourceware.org \ --to=wschmidt@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).