From patchwork Mon Oct 16 03:55:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Acker Brock X-Patchwork-Id: 153174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3240842vqb; Sun, 15 Oct 2023 22:01:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrQj+FFdK+ICq6WETAgkKVI/RM3MHh2EscdRJiJAyKaqNvGTJnynTLZujI/9svlaIvKus8 X-Received: by 2002:a05:6214:4342:b0:66d:1302:e278 with SMTP id of2-20020a056214434200b0066d1302e278mr9438875qvb.19.1697432470737; Sun, 15 Oct 2023 22:01:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697432470; cv=pass; d=google.com; s=arc-20160816; b=olypnUBRgz6lFmW0jnEdtq9NAfOswmdHG/TiwLo224V1hU2a84ditTf+SqW03p7sNc fizzSG7IynE/UCtRHPORUeIJ6s4MRLsZFFDyyQY6ASdm6ED43j7N/HtRmishcRo8+d5l P3eKRplsuwfMXJgX9vA2j8ly6zL5jWzvxKVP7i2W6Kiz2RRtJd1RJX/uIru7ze7avApA CT0MjAwsgbB5e+8O3lPqOzMkQhws1/zFTfh3xIsTal5A7rJfoPsHfrrimsMHSmcSUtXz 9bh+GriYxSt2zXT6faYAWTuQIzmclZ+auj5L/4Yfek6LIMoz06KGWlaxs9lDtPukrzih RgoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding:cc:to :subject:message-id:date:from:mime-version:dkim-signature:arc-filter :dmarc-filter:delivered-to; bh=Sr1Lo1md0UDA6ZNDflnLOn/1H8RpL0pGB9C/O6NCVho=; fh=L68QiWw03P2gtpWmaMIIvAl8Xss/0xs4aL0kWyQoGQ0=; b=W2Yt3Fr+fsE3FwlxFO5MnD9dIQCuzXf8Ae4al8LuYjNAC3Cm4XRkZpwNoXmnALukrn xBoqcYDQdHkHdALyzilucC8q64I34wMaicWVdBDcO2s2Q5zd9Qdnj15tQrKKbkWHAhg6 RkugQEKDRfY6c1RNQo94LiqG3DAPlG3rCqjrpJqY6XLu6dscQROp+mhBcXFq9XUpS02i o2lYEuCx3HhSPFT6NOyH/UfiB9Hkk0dxNm9uyUEAYGuE0/7T5M5DuZ9UFu56pcc/XvDk fo/Kj/i4PFf/x+LAjSBaktXJduDW1JU49YjQizG3pJFXTzjeLWLRZWJI8IrqS2I1uQUO Dtqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b=kw6YXWwI; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=berkeley.edu Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id dw17-20020a05620a601100b00773bbc97627si4722163qkb.467.2023.10.15.22.01.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 22:01:10 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b=kw6YXWwI; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=berkeley.edu Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C1C9A3856976 for ; Mon, 16 Oct 2023 03:56:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by sourceware.org (Postfix) with ESMTPS id D45EB3858D33 for ; Mon, 16 Oct 2023 03:55:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D45EB3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=berkeley.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=berkeley.edu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D45EB3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::834 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697428549; cv=none; b=ChF6MRsa0Q947A8QKUNzgsj5COrMCWweJuAJZthOOAQxAoMZ/NuQpgN1Oj03oVFSyzi5s8pmIu5xBlZv5jmCGYdHjD9Ltz5UZVkS8IDbv4C9OH1aPW5yG4/UHajuSWi0/zLiGfNUmTYV2D5a5vNosODpdt7UPvwK1AlTxWptVDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697428549; c=relaxed/simple; bh=PX5tDCgFfQxGi44FNBwpSqyjbNFeD0ctQa1BvMm9pOE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=piONWiEt1oU70YSjdC+i2UUi9agH5A8JtOIqWp2fwH6iiRkVxEnHocvGgVWaP8cPkUJwAw1lx9vzhb3RdWzEv7hbaciRCPLJhoMRS7EqjyFryN5iOwFOX1NVcuqu1c0vHoxFamtsc7JFQs8cLYlqCRqyABhOH285Z+fHfGP9NpE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-41b2bf4e9edso44276021cf.1 for ; Sun, 15 Oct 2023 20:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=berkeley.edu; s=google; t=1697428547; x=1698033347; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Sr1Lo1md0UDA6ZNDflnLOn/1H8RpL0pGB9C/O6NCVho=; b=kw6YXWwI2wh/77ugAOjblOZnUdVKN0GMXnbhxeHc71gUSTn8+ee0R1JTo4978wAcBu LEHOna9Z2+RuJR7Wbho+CxmGH59JxYyL4UVqToru9OwQSSkFguVtJdLp2zH6hzl7993e Q2ukoHSFp9m5GSVRWWKfvCgPEYIpEG7wUqkvbsGpLSXPtQDei3/DFQKgDQHYutdz0onG PqivHg1R39goF7T/++HlmpN58FjQ04y49DJlOdfnPGmiZWPmi12AJVO+G0xK2KiibZuD 6g5LBiIZKDlNIf0pqr2CRRHXUpAcO3UV0SOPgHK4QMvVIcfEG5nWCrgNZ8/PhqJysIFI kKlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697428547; x=1698033347; h=content-transfer-encoding:cc:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Sr1Lo1md0UDA6ZNDflnLOn/1H8RpL0pGB9C/O6NCVho=; b=XF/Yn6wbPijko1rxrS0Z0vVgSqGC6KEleYSzGgFIA9DHhky0dzltIc0+LUAA0wa0ZB uW0rOV27sTJWvF2jTI0JRjVw2W9/W34K/njDiLQvbZetCtNUOEdHGW8/BRs3qPwiByNH xPfopvFOi32oXwiiju/2JZfwhBrauVMz/24LN8nHMGtOAgohBQ4dMe3y+5rC07JFnh+Q 8bjSv3vKGFmdjADTjJJQndTzYmSoNvihH6Nb8MyPt+YQd0mwrtND0hdnC6Z1qqycektk /OyFHpE/nk1rHpAj9WmNQXLyZcbLTRZYIAjJzUEAvKAsUDF6X0bh6EEkYbLUbNORW57W 701A== X-Gm-Message-State: AOJu0YwhBdPbpVgW5MlbNjYp8mdeNaW4bzJ2Tt0BEX3MlvbIX1FrY5y9 DN2TOSmREumXdVrgL2rQBG8VYFMw4vnfne9O1aWiot3T427DDaG3HQ== X-Received: by 2002:ac8:7f02:0:b0:40f:d56b:6f8e with SMTP id f2-20020ac87f02000000b0040fd56b6f8emr7571769qtk.28.1697428546970; Sun, 15 Oct 2023 20:55:46 -0700 (PDT) MIME-Version: 1.0 From: Benjamin Acker Brock Date: Sun, 15 Oct 2023 20:55:36 -0700 Message-ID: Subject: [PATCH v2] libstdc++: Workaround for LLVM-61763 in ranges To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, jwakely.gcc@gmail.com X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779886950391690764 X-GMAIL-MSGID: 1779886950391690764 > I don't think this patch counts as legally significant, but if you contribute again in future you should be aware of https://gcc.gnu.org/contribute.html#legal and either complete the copyright assignment paperwork, or add a DCO sign-off to the commit message. Thanks for the reminder. I just added a sign-off. > This should be a complete sentence, so capital letter and full stop. Fixed! --- Signed-off-by: Benjamin Brock libstdc++-v3/ChangeLog: * include/std/ranges: Implement workaround for LLVM-61763 in zip_view and adjacency_view. --- constexpr explicit @@ -4652,11 +4655,13 @@ namespace views::__adaptor return input_iterator_tag{}; } +#ifndef __clang__ // LLVM-61763 workaround template requires (view<_Ws> && ...) && (sizeof...(_Ws) > 0) && is_object_v<_Fp> && regular_invocable<_Fp&, range_reference_t<_Ws>...> && std::__detail::__can_reference...>> friend class zip_transform_view; +#endif public: // iterator_category defined in __zip_view_iter_cat @@ -5327,6 +5332,9 @@ namespace views::__adaptor template class adjacent_view<_Vp, _Nm>::_Iterator { +#ifdef __clang__ // LLVM-61763 workaround + public: +#endif using _Base = __detail::__maybe_const_t<_Const, _Vp>; array, _Nm> _M_current = array, _Nm>(); @@ -5367,12 +5375,14 @@ namespace views::__adaptor friend class adjacent_view; +#ifndef __clang__ // LLVM-61763 workaround template requires view<_Wp> && (_Mm > 0) && is_object_v<_Fp> && regular_invocable<__detail::__unarize<_Fp&, _Mm>, range_reference_t<_Wp>> && std::__detail::__can_reference, range_reference_t<_Wp>>> friend class adjacent_transform_view; +#endif public: using iterator_category = input_iterator_tag; diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 1d529a886be..7893e3a84c9 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -4632,6 +4632,9 @@ namespace views::__adaptor class zip_view<_Vs...>::_Iterator : public __detail::__zip_view_iter_cat<_Const, _Vs...> { +#ifdef __clang__ // LLVM-61763 workaround + public: +#endif __detail::__tuple_or_pair_t>...> _M_current;