From patchwork Wed Nov 6 17:52:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1190586 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512634-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FbhRfTAc"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="OaDm5lVR"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 477Yz351B3z9s7T for ; Thu, 7 Nov 2019 04:52:47 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=UzSmcYtqTAvKq9m23bjbOJ91n+DMpWt7br3tEilnblwayz8uh8dC6 tu0l9vVocGfCOeXOjwzChywhCtSHdozylWHutyBybl8p/QDiM4DCtikvq8CiML5v n58fIht8wC6Hs2eK6+csMoTb1zmYUxVTPG87koQHf8+t4CQUCAMypg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=5oX70YKCI0uzr5JOBOAfxhnPfF0=; b=FbhRfTAcrRVREpx3G6KV LGX5/m3P2HjyUpP2YMtSPyjfxoC03meQ87BOxO3PkIw2IQqELRNZ7lx8r+/uE3iX L+BCK0xcJ5FTSvbD3/IRCnmz0+lT4HxGbPwsV4YJHd/6otec0dfQXLLtDHPkgu+e ee681WgQXjQ/zQTf6UrYwSk= Received: (qmail 64702 invoked by alias); 6 Nov 2019 17:52:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 64632 invoked by uid 89); 6 Nov 2019 17:52:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=unavailable version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Nov 2019 17:52:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573062748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=JjIqmHLs9uXCGiABEODk/jCktwlYIjtxI5U64g8dPO4=; b=OaDm5lVRmwZU1WhbCr0ebUo77b4PtQa6QTGaUCEnYs7qsOq/tJBa8+BYd7F8cRnu7ydqYE CRtN2RKXjklbg/igxjfvj1mbh1Oqmd88jXU52eTqatLbJEpNPYxmVD43ShWuGM6mxiMp+i lKtBIK8bEJ64yPhV9VZLekCXBNrHiOo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-410-EQFpGdATOtSdvU1Vzzny5Q-1; Wed, 06 Nov 2019 12:52:24 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F6698017E0; Wed, 6 Nov 2019 17:52:23 +0000 (UTC) Received: from localhost (unknown [10.33.36.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id D77615D70E; Wed, 6 Nov 2019 17:52:22 +0000 (UTC) Date: Wed, 6 Nov 2019 17:52:21 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++: remove redundant equality operators Message-ID: <20191106175221.GA6727@redhat.com> MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.12.1 (2019-06-15) X-Mimecast-Spam-Score: 0 Content-Disposition: inline Now that operator<=> is supported, these operators can be generated by the compiler. * include/bits/iterator_concepts.h (unreachable_sentinel_t): Remove redundant equality operators. * testsuite/util/testsuite_iterators.h (test_range::sentinel): Likewise. Tested powerpc64le-linux, committed to trunk. commit f11a631b97047ef97d7658ca6aebeb392d55f2b3 Author: Jonathan Wakely Date: Wed Nov 6 00:53:23 2019 +0000 libstdc++: remove redundant equality operators Now that operator<=> is supported, these operators can be generated by the compiler. * include/bits/iterator_concepts.h (unreachable_sentinel_t): Remove redundant equality operators. * testsuite/util/testsuite_iterators.h (test_range::sentinel): Likewise. diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h index e30645e05cf..8b398616a56 100644 --- a/libstdc++-v3/include/bits/iterator_concepts.h +++ b/libstdc++-v3/include/bits/iterator_concepts.h @@ -797,23 +797,6 @@ namespace ranges friend constexpr bool operator==(unreachable_sentinel_t, const _It&) noexcept { return false; } - -#ifndef __cpp_lib_three_way_comparison - template - friend constexpr bool - operator!=(unreachable_sentinel_t, const _It&) noexcept - { return true; } - - template - friend constexpr bool - operator==(const _It&, unreachable_sentinel_t) noexcept - { return false; } - - template - friend constexpr bool - operator!=(const _It&, unreachable_sentinel_t) noexcept - { return true; } -#endif }; inline constexpr unreachable_sentinel_t unreachable_sentinel{}; diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h index d20257c1b31..4c5e9a3cc1d 100644 --- a/libstdc++-v3/testsuite/util/testsuite_iterators.h +++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h @@ -677,15 +677,6 @@ namespace __gnu_test friend bool operator==(const sentinel& s, const I& i) { return s.end == i.ptr; } - - friend bool operator!=(const sentinel& s, const I& i) - { return !(s == i); } - - friend bool operator==(const I& i, const sentinel& s) - { return s == i; } - - friend bool operator!=(const I& i, const sentinel& s) - { return !(s == i); } }; auto