From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1725) id 3AE323894C1A; Tue, 18 Aug 2020 18:19:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AE323894C1A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597774783; bh=TrpheiBwkdt63tiVeoBBfA86D+4MazTRi9G/8PQ5HhI=; h=From:To:Subject:Date:From; b=WjS1Rv8R2kgTk+oIjQLkUr46w1hx2Ydu0KD7Hg98AU3l4K231S1beopwZ1ERzIzAW Whu7uyI9zkl3/3zWXBsNZy7Go/dosKKmP6ILmpf7cwOzn3A5pWLHHn1pte9qgBpsDc gBLGwPnM4rZQ+dEAcXefYlgS+sR/chqUzXhanFVQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: William Schmidt 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 X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/users/wschmidt/heads/builtins3 X-Git-Oldrev: 95edead9aab7a70636f87ea041f05469dc41d9a9 X-Git-Newrev: 8e2592a88821511aa45c3325246f3b08a88fa063 Message-Id: <20200818181943.3AE323894C1A@sourceware.org> Date: Tue, 18 Aug 2020 18:19:43 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2020 18:19:43 -0000 https://gcc.gnu.org/g:8e2592a88821511aa45c3325246f3b08a88fa063 commit 8e2592a88821511aa45c3325246f3b08a88fa063 Author: Jonathan Wakely 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(true), ""); - static_assert(test_category(true), ""); static_assert(test_category(true), ""); static_assert(test_category(true), ""); static_assert(test_category(true), ""); - pos(); +#if __cplusplus == 201703L + static_assert(test_category(true), ""); + pos(); +#endif // Negative tests. static_assert(test_category(false), ""); neg(); +#if __cplusplus > 201703L + // In C++20 aggregates cannot have user-declared constructors. + static_assert(test_category(false), ""); + neg(); +#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>::value, ""); +#if __cplusplus == 201703L +// In C++20 operator!= can be synthesized from operator== static_assert(!is_neq_comparable>::value, ""); +#endif static_assert(!is_lt_comparable>::value, ""); static_assert(!is_gt_comparable>::value, ""); static_assert(!is_le_comparable>::value, "");