From patchwork Mon Nov 15 07:50:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1555184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=Et35qdJb; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Ht1ct1kTVz9s1l for ; Mon, 15 Nov 2021 18:52:28 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35CDF385800A for ; Mon, 15 Nov 2021 07:52:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35CDF385800A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636962746; bh=e+bdkVCbLx6TT3hYQh4wZx1YHThm5KeirjIvT84Vsak=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Et35qdJbMJSXbqmSL8fhb/mf9M50DdoQEVPKxuymkJgpypE73z7LHbkhTfjsPPOs2 aZMYV3hb5pAJAeb8xBAsJ6apm3oQFLQBLOf5V3Iansqzg8RQwvpln97qvoXtuU8F6+ LIjJMA5BYLUHMfotTlDc5bZSKGF+UOI5RnIq/a2U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 459D33858036 for ; Mon, 15 Nov 2021 07:50:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 459D33858036 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-zTpTRabZOP2483vLymLWsw-1; Mon, 15 Nov 2021 02:50:44 -0500 X-MC-Unique: zTpTRabZOP2483vLymLWsw-1 Received: by mail-qt1-f197.google.com with SMTP id h13-20020ac87d4d000000b002af9c496444so12773063qtb.22 for ; Sun, 14 Nov 2021 23:50:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=e+bdkVCbLx6TT3hYQh4wZx1YHThm5KeirjIvT84Vsak=; b=mWjjXAggRVMx8f5I4aF2hwuuBSePLcyMVif2fwohgdTRY7QAx4CztGOZudeXV114bB T3s/EqEabUYA/6FScPcF/lhwr9zhuML/JEopZUkh49l74tbF9qfwZ4KjB+XM5IxEeQ2G o27M0IEgUn+IbJSV8arlVNOwEvkinBFQouu80FbkRQoCGmViQ8M4SIURfqeUo5sfdftl eTs6IXjbMQ/cguPbX7E8xfFut3dyV8DtPM4l1C3H198Edee4LpQJxFA+4V/gV55KRSjU F302uH0pVnwDgFZvkyNaGiYs2CpxRIPvqP+I770LX9yrWL+YBO2JYM+mMXvb0rVz6u39 rgvQ== X-Gm-Message-State: AOAM533cl4gEDl9iCE3MUzYenYXjY9yM2XWXzUNUesbdS03rFPv2ugl2 jE6BxauRsWICCv7QQNmdh7mmklEZFdTZBbmK+FN4ZOp/eWDy9UHCMM0gtW39CpRTXwuLcIvXurD /6sOzDS1SH6rkcPZ53xZ93LT3yMJ3iGtphnfUbBVKBt3FbzMnBBA//Ak9vnoUjALp3w== X-Received: by 2002:ac8:7e95:: with SMTP id w21mr37978475qtj.22.1636962644113; Sun, 14 Nov 2021 23:50:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbEQf9CI1QtrdaQl7+nRnOcAeuHAQv0r2qJ5GDS02cshKmFDPrF5yHEXts1wiw5l/flosuJw== X-Received: by 2002:ac8:7e95:: with SMTP id w21mr37978452qtj.22.1636962643768; Sun, 14 Nov 2021 23:50:43 -0800 (PST) Received: from barrymore.redhat.com (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id v3sm6304149qkd.20.2021.11.14.23.50.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Nov 2021 23:50:43 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: is_this_parameter and coroutines proxies Date: Mon, 15 Nov 2021 02:50:41 -0500 Message-Id: <20211115075041.3355078-1-jason@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Compiling coroutines/pr95736.C with the implicit constexpr patch broke because is_this_parameter didn't recognize the coroutines proxy for 'this'. Tested x86_64-pc-linux-gnu, applying to trunk. gcc/cp/ChangeLog: * semantics.c (is_this_parameter): Check DECL_HAS_VALUE_EXPR_P instead of is_capture_proxy. --- gcc/cp/semantics.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) base-commit: bd95d75f3412e1a7debab7c6c602ba409f274eb5 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 60e0982cc48..15404426bce 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -11382,7 +11382,8 @@ is_this_parameter (tree t) { if (!DECL_P (t) || DECL_NAME (t) != this_identifier) return false; - gcc_assert (TREE_CODE (t) == PARM_DECL || is_capture_proxy (t) + gcc_assert (TREE_CODE (t) == PARM_DECL + || (TREE_CODE (t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (t)) || (cp_binding_oracle && TREE_CODE (t) == VAR_DECL)); return true; }