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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 828393858D33 for ; Fri, 10 Nov 2023 00:44:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 828393858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 828393858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699577096; cv=none; b=AbvoNPzdaXFbRICWKTS6WRnV6WW/sQopbUBe1IBdY3xoAnMOWaGuWszWTyzKAHy6RyeTgA7UnRHSLcRjEqtbUBCCpbr/9wK0s92DLzNcXOMQidlTdjkcMkfQc3DoEQQ1We+YKjAa96lQQrFuWIEHrI8ecYi5kuOID7/Ykr+xWbA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699577096; c=relaxed/simple; bh=FRbk6se18dEd5IabtmtTCxkMAxwlPOkIlUQJR4JQ/Pw=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=lSxO0p/Mne9apHFbP5Naad0wOFjctGa7LGvfeXlb9T1uVSxYSQmjZUAlqeo546RaFfRBraUnCKTGjMw2ldtPSH/xuZpi/Ayi3UxiDYk0lioXN3sIM+2pnQAq5pIQ3JqpMLgfTmnjszX+7gEXb5r79DVc0K7IKPSEj2N2XSsObNE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699577095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zvODcRLbdTXpLTXhwRT4DLLIrkIhvH6N2qcFnUjsqTU=; b=D9+S2UPXShpCJ+l6+xq3rZIFf3z3klYdZWASsXxkbkeYe4nJguEYKz31J0/mLBl1v/TRc2 uAFndwWUyTeyuw/qnQOPf5jWm73xKSGry8UEhMMcPoLemxF33iSKCFCyIGdtI2BymV6uXr +LWfToC5qbQSWohM0MfIE5yDJhfxPHw= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-606-QyBrER2XPfGLc2QAujO76g-1; Thu, 09 Nov 2023 19:44:53 -0500 X-MC-Unique: QyBrER2XPfGLc2QAujO76g-1 Received: by mail-vk1-f198.google.com with SMTP id 71dfb90a1353d-4abee07bccbso664602e0c.3 for ; Thu, 09 Nov 2023 16:44:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699577093; x=1700181893; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zvODcRLbdTXpLTXhwRT4DLLIrkIhvH6N2qcFnUjsqTU=; b=TXx8NdL1zO9BjJ/UHoNGTwtUwKCO0C5WcbY6n9dre/r2HrOVIvFRG7DxGo20d84jjx yE33ZMsErxZGc4jRNK1ZycuzzIUQhbJWOcmudyQlUzTxa8XU0esBzLB2r/4LEkEJG+HY 0Si+SF9BrSmuCrJkTFUvfUu2tbwRlZ6D8EfC5cnBpQoDWb2+evll53ue0v0Wgncwk5HO 9XSXayKklsRsSvFrnl0PthvGjh6dnQvKszMsxXnseAddaBIXC7WTYOPzF6NXUH4mHqNO fOYAP/CWGrxmPHoFWuNoMoWWNWFErEyFEMRzDC5KuqZU61eTWUoZQ51kxDBl4dU0lIKz 4CvQ== X-Gm-Message-State: AOJu0Yzy9e6JraaCqVROKRoDOrqeu+UXI5OuFMoEtUG1j02i5BK+b1En nRnfdQ6+BuGqRswdPk04IVcDiNriMSsfQoqq+qRaSa0LFvs6oQmCIeGGMrCbOEOnSduQvUqMwKA hCDzbCT7nn3AzxQN2zA== X-Received: by 2002:a05:6122:32c3:b0:4ac:8914:ed70 with SMTP id ck3-20020a05612232c300b004ac8914ed70mr3379800vkb.16.1699577092769; Thu, 09 Nov 2023 16:44:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUiQ6kkwrLnfZ1Sr4UxBr4/8ljqKxBJqUsCK0pKhJczYX4CnRnya/A4eBpkmijiPq1Y+Uh0w== X-Received: by 2002:a05:6122:32c3:b0:4ac:8914:ed70 with SMTP id ck3-20020a05612232c300b004ac8914ed70mr3379784vkb.16.1699577092443; Thu, 09 Nov 2023 16:44:52 -0800 (PST) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id cb18-20020a05622a1f9200b0041950c7f6d8sm2392390qtb.60.2023.11.09.16.44.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Nov 2023 16:44:52 -0800 (PST) Message-ID: <6861efbc-7235-4dde-8221-800ed1593451@redhat.com> Date: Thu, 9 Nov 2023 19:44:51 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++: fix tf_decltype manipulation for COMPOUND_EXPR To: Patrick Palka , gcc-patches@gcc.gnu.org References: <20231107150838.1031324-1-ppalka@redhat.com> From: Jason Merrill In-Reply-To: <20231107150838.1031324-1-ppalka@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.3 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_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/7/23 10:08, Patrick Palka wrote: > bootstrapped and regtested on x86_64-pc-linxu-gnu, does this look OK for trunk? > > -- >8 -- > > In the COMPOUND_EXPR case of tsubst_expr, we were redundantly clearing > the tf_decltype flag when substituting the LHS and also neglecting to > propagate it when substituting the RHS. This patch corrects this flag > manipulation, which allows us to accept the below testcase. > > gcc/cp/ChangeLog: > > * pt.cc (tsubst_expr) : Don't redundantly > clear tf_decltype when substituting the LHS. Propagate > tf_decltype when substituting the RHS. > > gcc/testsuite/ChangeLog: > > * g++.dg/cpp0x/decltype-call7.C: New test. > --- > gcc/cp/pt.cc | 9 ++++----- > gcc/testsuite/g++.dg/cpp0x/decltype-call7.C | 9 +++++++++ > 2 files changed, 13 insertions(+), 5 deletions(-) > create mode 100644 gcc/testsuite/g++.dg/cpp0x/decltype-call7.C > > diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc > index 521749df525..5f879287a58 100644 > --- a/gcc/cp/pt.cc > +++ b/gcc/cp/pt.cc > @@ -20382,11 +20382,10 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl) > > case COMPOUND_EXPR: > { > - tree op0 = tsubst_expr (TREE_OPERAND (t, 0), args, > - complain & ~tf_decltype, in_decl); > - RETURN (build_x_compound_expr (EXPR_LOCATION (t), > - op0, > - RECUR (TREE_OPERAND (t, 1)), > + tree op0 = RECUR (TREE_OPERAND (t, 0)); > + tree op1 = tsubst_expr (TREE_OPERAND (t, 1), args, > + complain|decltype_flag, in_decl); > + RETURN (build_x_compound_expr (EXPR_LOCATION (t), op0, op1, > templated_operator_saved_lookups (t), > complain|decltype_flag)); Hmm, passing decltype_flag to both op1 and the , is concerning. Can you add a test with overloaded operator, where the RHS is a class with a destructor? Jason