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.129.124]) by sourceware.org (Postfix) with ESMTPS id C297E384645B for ; Wed, 10 Apr 2024 16:50:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C297E384645B 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 C297E384645B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712767858; cv=none; b=gzYa9aIP2lvanY5IZYXmA/JiWNXEJnwxYM8IO4GNVqCTPo8bZZV34tuQXHz/4U1qHtl/tGUeOdyPQuecrrykrhIJb8RccdFe0t2yZiKM44HRCLCHhc194P4hf93KEMu+1gBHoBOn/vmkZ062w3TFjJ0L2WHzQDJUh6TjPvNgRuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712767858; c=relaxed/simple; bh=JuCjmb/GDIU9BXQAcCVNwQ4ngAcqszE0NqhOBmnLICg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=MBI01Qa0g2Xk0Y+ORIoDDulybd0r+QhxLU9X4Sph+X4t+j1weJIrn6ZuW5vphwnwcFv+8aDctca5qLHll2IFDxzOVis2UvKOjnoWrvG5dcfsTfMhtvm6Yh33bAUP4fx9z8hJrWni0PTVY01DmbIPVUJCk2mPsu+/2RpXs9CdzdQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712767846; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=HertdKH8GaIgfquK0R/JP2eA87Bp7iSWoGZP1ipIFcA=; b=cIJLDKrE5PttAwbPTtqm8GFWcYBt5xJuolgiMHpsI0un1jQ3yIu08JHjn6NnU5vNrACyb9 gQy+2nZ6AuViVqsgRcHehUQPMMkS11WqTF6v0nSBdZTwLoLf1DtGt+m9IKCZfDPSyiBCIZ L+wZ7uxEzkzhlb8LtJlkeZEUspCamgY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-99-4EETjKp5PAu9p5u9JN9JYg-1; Wed, 10 Apr 2024 12:50:45 -0400 X-MC-Unique: 4EETjKp5PAu9p5u9JN9JYg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 132A138035A5; Wed, 10 Apr 2024 16:50:45 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.224.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCDCC492BC6; Wed, 10 Apr 2024 16:50:44 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 43AGodY9113330 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 10 Apr 2024 18:50:39 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 43AGod4B113329; Wed, 10 Apr 2024 18:50:39 +0200 Date: Wed, 10 Apr 2024 18:50:38 +0200 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org, jason@redhat.com Subject: Re: [PATCH] c++/114409 - ANNOTATE_EXPR and templates Message-ID: Reply-To: Jakub Jelinek References: <20240410164306.EFDB113942@imap1.dmz-prg2.suse.org> MIME-Version: 1.0 In-Reply-To: <20240410164306.EFDB113942@imap1.dmz-prg2.suse.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: On Wed, Apr 10, 2024 at 06:43:02PM +0200, Richard Biener wrote: > The following fixes a mismatch in COMPOUND_EXPR handling in > tsubst_expr vs tsubst_stmt where the latter allows a stmt in > operand zero but the former doesn't. This makes a difference > for the case at hand because when the COMPOUND_EXPR is wrapped > inside an ANNOTATE_EXPR it gets handled by tsubst_expr and when > not, tsubst_stmt successfully handles it and the contained > DECL_EXPR in operand zero. > > The following makes handling of COMPOUND_EXPR in tsubst_expr > consistent with that of tsubst_stmt for the operand that doesn't > specify the result and thus the reason we choose either or the > other for substing. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? > > Thanks, > Richard. > > PR c++/114409 > gcc/cp/ > * pt.cc (tsubst_expr): Recurse to COMPOUND_EXPR operand > zero using tsubst_stmt, when that returns NULL return > the subst operand one, mimicing what tsubst_stmt does. > > gcc/testsuite/ > * g++.dg/pr114409.C: New testcase. I've posted https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114409#c16 for this already and Jason agreed to that version, so I just have to test it tonight: https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649165.html Jakub