From patchwork Sat Aug 5 15:57:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xeon khjj X-Patchwork-Id: 131497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp523792vqr; Sat, 5 Aug 2023 08:58:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUZNF7L85tuhRjvzFfIScZIH9D7juuQvKPjQk0fF7vKC91EyWjl7knaginquSqRJtitmGL X-Received: by 2002:a2e:9bd8:0:b0:2b9:ea17:558b with SMTP id w24-20020a2e9bd8000000b002b9ea17558bmr3470709ljj.16.1691251134221; Sat, 05 Aug 2023 08:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691251134; cv=none; d=google.com; s=arc-20160816; b=WKj8w6NBAku0mN+XDir8JFinUjth1VRFgV5jjHlijpM+4yDwkBGjKXvf1Qgki/vNHw n2MvPLeDyAVDdjktdD1njeAnuo5QuddDGA8eb02Idp/aPtwquBLUCmZU+lZTuCBXG85m lM13FAb7/NfnR+Q+4M+l4T2GFnsl2VkBaji3kh/yZ/p3k9hIybRFKsX4ugkCaDIFBuRR 3oFu1bREaIE2h8E6DT8eBSzrcASB2WnsIgu6GeCbqPYBtlyd6LxAPcgra6HaW28tS8bJ AD6Ojmn4wShgsiDdEJDTmXhKxVfDGWnYB06E4AZF6QjGavddbF/kNoU4uSHEgJnNNWwm 01uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:to:subject :message-id:date:mime-version:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=Yk6JSz182USNOdiypqG4zt36Y8LsHtlWKK/0lK5hA0Y=; fh=qbBHvP4divkEPLSckJwDNBMPcIQvqYf/newRZ6mt/Tg=; b=A8ipgIGJxvqj/S/07xvNHDjyGsDhMKEpl4FNjPiQHFVatsZqerZbIp2Da7lPNthtFl rvfXN+u4UEE4xrGJfWAy4dAS1F3pCDHsduKebvRNphCtALGooag/zx8bgemsneOhMnvw +6812+MEy8h6y/a6poPiz13Yr/RrITLJPWKAkagxNIbqCrn4Z7YUxMmemKcdMGFZY1xJ A34mJUGdExMqMrPlJX8+lpI6hf4V/D5uiV+o44bHqr2YlFYLsi1VOud1fFqUQgOSqg/T CjsrlQR1tVZZ411WcgB8xotdbfgvVpTx6PWz7Xe1tDxbgQ79JbiM3XRyQHSTXUtqEmCY xvGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Cka4oo6X; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id sd23-20020a170906ce3700b0099cb0d4f9besi1657807ejb.26.2023.08.05.08.58.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Aug 2023 08:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Cka4oo6X; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B8853858C1F for ; Sat, 5 Aug 2023 15:58:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B8853858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691251133; bh=Yk6JSz182USNOdiypqG4zt36Y8LsHtlWKK/0lK5hA0Y=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Cka4oo6X+DMEHN64RA+0YlXpt7NwPnL8Cj1njPF9qys9svzO/yYjymypjL/V6hOYC aewLRtHMXM9WCj5NbY3PoygvsuJKhVW/m/IFjoxpCH1yFFQf221LVUuPgyW+AJnOBI iBYmddJw4Jv5D/k9odOUlMK2ZlkHbG0zT/PyRIW4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id CD1763858D35 for ; Sat, 5 Aug 2023 15:58:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CD1763858D35 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b9cdbf682eso48630721fa.2 for ; Sat, 05 Aug 2023 08:58:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691251089; x=1691855889; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aODfr29/ycEy0mnsJfs7IW0eZ+MNAC8ihwmmkZgkTwU=; b=SJw3swzBx0+iYLj1DuDpfgzFCD3U+5wz/Y5EGUOOpe/NGBzbjtGwg1IXg+FgGosbr0 b5mZZW8mx+LPaN+mPjOrBPhM7Krq0456gk4fZjNBBP9MN1OK4jag/5C02QWATIiY6dXD 9+ImXw9Pddtbet0znn0ObXXSYhEfuCVy25tyfuPC2FUxqQVjQ6A056bSm8kss0OdJu4u MOHHU7Ckje0Rk3fqIDtquzXs/cMqP/NKi42w1fFnQ9m+athar0mDCGW931gzChFbdp3M VZbWfoY+mzX3E916ZMqWpcb46DaEd/wJTj6L/Y9AATawyBDww/dbz8OMlgUDiwEktu85 in8w== X-Gm-Message-State: AOJu0YzLHk3CluhrAcYM0UA0CCAhSptCnMW+/shc//b9NoCYgrbJB5VK +P9/dRpUNUt/qJazZkREsrZvX7TdTEEblZT4aA79cQJXRUVW8w== X-Received: by 2002:a05:6512:310c:b0:4fb:2c1e:4e03 with SMTP id n12-20020a056512310c00b004fb2c1e4e03mr2869546lfb.32.1691251088372; Sat, 05 Aug 2023 08:58:08 -0700 (PDT) MIME-Version: 1.0 Date: Sat, 5 Aug 2023 23:57:56 +0800 Message-ID: Subject: To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, FROM_LOCAL_HEX, GIT_PATCH_0, HTML_MESSAGE, KAM_BLANKSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: xeon khjj via Gcc-patches From: xeon khjj Reply-To: xeon khjj Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773405349460163278 X-GMAIL-MSGID: 1773405349460163278 From 104178c3912314f41a61a316e7c3bc0487ea8f3c Mon Sep 17 00:00:00 2001 From: K1ZeKaTo Date: Sat, 5 Aug 2023 14:50:19 +0000 Subject: [PATCH] Make the rvalue work fine. It seems not considering the rvalue in the last version. --- libstdc++-v3/include/bits/iterator_concepts.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h index e32e94dc9fc..8bb7c0fb8c0 100644 --- a/libstdc++-v3/include/bits/iterator_concepts.h +++ b/libstdc++-v3/include/bits/iterator_concepts.h @@ -86,14 +86,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION concept __can_reference = requires { typename __with_ref<_Tp>; }; template - concept __dereferenceable = requires(_Tp& __t) + concept __dereferenceable = requires(_Tp&& __t) { - { *__t } -> __can_reference; + { *static_cast<_Tp&&>(__t) } -> __can_reference; }; } // namespace __detail template<__detail::__dereferenceable _Tp> - using iter_reference_t = decltype(*std::declval<_Tp&>()); + using iter_reference_t = decltype(*std::declval<_Tp&&>()); namespace ranges { @@ -116,7 +116,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template requires __adl_imove<_Tp> struct __result<_Tp> - { using type = decltype(iter_move(std::declval<_Tp>())); }; + { using type = decltype(iter_move(std::declval<_Tp&&>())); }; template requires (!__adl_imove<_Tp>) @@ -129,9 +129,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _S_noexcept() { if constexpr (__adl_imove<_Tp>) - return noexcept(iter_move(std::declval<_Tp>())); + return noexcept(iter_move(std::declval<_Tp&&>())); else - return noexcept(*std::declval<_Tp>()); + return noexcept(*std::declval<_Tp&&>()); } public: @@ -148,9 +148,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if constexpr (__adl_imove<_Tp>) return iter_move(static_cast<_Tp&&>(__e)); else if constexpr (is_lvalue_reference_v>) - return static_cast<__type<_Tp>>(*__e); + return static_cast<__type<_Tp>>(*static_cast<_Tp&&>(__e)); else - return *__e; + return *static_cast<_Tp&&>(__e); } }; } // namespace __cust_imove