From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 1463F386F460 for ; Wed, 10 Apr 2024 17:10:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1463F386F460 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1463F386F460 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712769069; cv=none; b=H6KjWHfH7LG/aeuRBRl9A3Q9TwcWUai1qB5+D61yFLJiHGmm3LzUlQnQpwSaLvjsX/mm8+jB9Vbi0k8b+ZdD61EyRHkK88jYRKv+zVKfOwkY3Wm0TernOblc+ZARb/CcZakTU7VOCZ7HTXwmu8pxIqpI7zeJK2eCNrs8lBwipJo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712769069; c=relaxed/simple; bh=sUjfLqHNz75wyhU0vnrxw0TZznuls+SoXa/gqcjDm60=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=w07IHIxbMsLSvZnIHSPDNoZd9jtLcyfv4juODlcHQUNYlJGs6OgyOe2rwkq2ZnhDa2eUpZ6tVACpq8YMoBZXBdNXJ+ba6S6sDRRQ74spz9QZ5Pyjq4F0O/wEiAr3Dc7mDyFoL2zzKDiRZkKXZFBAspQqzF1XOetUHKcs9fI7m7k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.168.5.241] (unknown [10.168.5.241]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id 44C5F20866; Wed, 10 Apr 2024 17:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712769052; h=from:from:reply-to: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=d0ATh6J++y77JnoItIRIRfcYbR/CtBWp3hv+ZUSTSEQ=; b=IP3WTsAR4wKo2jxeK3/pzOMKoC2mLj2609Ha007xh9dyq7LP6WCgJwQWmQXSyK9rZX7dv+ nfPQeccDKqs2q+Sh68WNNxG1OTvcVP5fIw33vwh2nBxhQ8fls+rBE8+wJnCEqL4YBmkdG0 Qx9LSlafmmudZukyvoq2K6tWy0Cn0LY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712769052; h=from:from:reply-to: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=d0ATh6J++y77JnoItIRIRfcYbR/CtBWp3hv+ZUSTSEQ=; b=RJUWHh9HC9F2uqn70NeKtr0B5V98nA3jmtpUhabbMYDny/52i3Nc4GFc6EcSTCJk2tMu25 62Yra+9trfDDxuCQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712769052; h=from:from:reply-to: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=d0ATh6J++y77JnoItIRIRfcYbR/CtBWp3hv+ZUSTSEQ=; b=IP3WTsAR4wKo2jxeK3/pzOMKoC2mLj2609Ha007xh9dyq7LP6WCgJwQWmQXSyK9rZX7dv+ nfPQeccDKqs2q+Sh68WNNxG1OTvcVP5fIw33vwh2nBxhQ8fls+rBE8+wJnCEqL4YBmkdG0 Qx9LSlafmmudZukyvoq2K6tWy0Cn0LY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712769052; h=from:from:reply-to: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=d0ATh6J++y77JnoItIRIRfcYbR/CtBWp3hv+ZUSTSEQ=; b=RJUWHh9HC9F2uqn70NeKtr0B5V98nA3jmtpUhabbMYDny/52i3Nc4GFc6EcSTCJk2tMu25 62Yra+9trfDDxuCQ== Date: Wed, 10 Apr 2024 19:10:52 +0200 (CEST) From: Richard Biener To: Jakub Jelinek cc: gcc-patches@gcc.gnu.org, jason@redhat.com Subject: Re: [PATCH] c++/114409 - ANNOTATE_EXPR and templates In-Reply-To: Message-ID: <7o667262-s25q-q265-123s-355r6729p937@fhfr.qr> References: <20240410164306.EFDB113942@imap1.dmz-prg2.suse.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Score: -4.30 X-Spam-Level: X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; DBL_BLOCKED_OPENRESOLVER(0.00)[pt.cc:url,suse.de:email,gnu.org:url] X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,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 List-Id: On Wed, 10 Apr 2024, Jakub Jelinek wrote: > 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 Ah, I saw the bugzilla patches and wanted this version to be sent because I think the COMPOUND_EXPR inconsistency is odd. So Jason, please still have a look, not necessarily because of the bug which can be fixed in multiple ways but because of that COMPOUND_EXPR handling oddity (there are already some cases in tsubst_expr that explicitly recurse with tsubst_stmt). Richard. -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)