From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id AE5003848425 for ; Fri, 4 Jun 2021 20:41:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE5003848425 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-593-00-ueE3ZOQ6uFWymZSitRQ-1; Fri, 04 Jun 2021 16:41:24 -0400 X-MC-Unique: 00-ueE3ZOQ6uFWymZSitRQ-1 Received: by mail-wm1-f72.google.com with SMTP id n20-20020a05600c4f94b029017f371265feso5063295wmq.5 for ; Fri, 04 Jun 2021 13:41:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p+ZfJWXjCSU41qBWA/A3Z0fjZEv7Z484yxDnwPg17pU=; b=KfOHqiC8/SbMC8MnfF07s0sl2sBnW/ClYxN/n0t8Xtt5jngW1MzkPyPK5dGHIYfEYA vHToizhBe/boAbm0fibZdGGZcD6wjz2JxNmadq/e21RRLfRUDFf4ytulfW5KpY/81EGr c+/3IqVS1Hoby9v1Uk7f8xxv7xOdSdPPlMqJXHGUAM7ezkuU15nHse1Nv/99PKbpFhYi fcZusqRWTr38O1neICjZbhxEhY66z+geBYtmILscyJhKvHd/iQaU1PznuSzdz5AKGulo s3ARG12diTAzZwFetVpDXmpzU4xiUcikPuIyANjinjw3B6ujBXXQJ+fLvd5abBW9woud fAgg== X-Gm-Message-State: AOAM531eJkSsNQXqc9MnV/rlBoUoiPvOiO2RhKeSA846k1Dnc2Ym7Jw1 Fuui0PKkDVSqcwCA6wsLQDqxecKkq1itAXo350Q9+mUNUm/8h9EqfrJMW82cJz5ewVp6587Trli fpvJvn/ZyH3DfXmMJfafCqwfI7nbav5c= X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr5739131wrx.13.1622839283101; Fri, 04 Jun 2021 13:41:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTLUY5iYRFgkaLlvV/bkzt6UXOMkKA8hZ3Ki42q9m88WczCd6g7Bts7VEqLhzZliwMyUdHYQG1SJ+0W8aXN7Q= X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr5739124wrx.13.1622839282943; Fri, 04 Jun 2021 13:41:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 4 Jun 2021 21:41:11 +0100 Message-ID: Subject: Re: [PATCH] PR libstdc++/98842: Fixed Constraints on operator<=>(optional, U) To: "Seija K." Cc: "gcc-patches@gcc.gnu.org" , "libstdc++@gcc.gnu.org" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 20:41:38 -0000 On Thu, 3 Jun 2021 at 17:27, Seija K. via Libstdc++ wrote: > The original operator was underconstrained. _Up needs to fulfill > compare_three_way_result, > as mentioned in this bug report > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98842 > Thanks, I'll get the patch applied next week. > diff --git a/libstdc++-v3/include/std/optional > b/libstdc++-v3/include/std/optional > index 8b9e038e6e510..9e61c1b2cbfbd 100644 > --- a/libstdc++-v3/include/std/optional > +++ b/libstdc++-v3/include/std/optional > @@ -1234,7 +1234,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > { return !__rhs || __lhs >= *__rhs; } > > #ifdef __cpp_lib_three_way_comparison > - template > + template _Up> > constexpr compare_three_way_result_t<_Tp, _Up> > operator<=>(const optional<_Tp>& __x, const _Up& __v) > { return bool(__x) ? *__x <=> __v : strong_ordering::less; } > >