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 B01EC3858409 for ; Tue, 28 Nov 2023 21:32:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B01EC3858409 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 B01EC3858409 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=1701207170; cv=none; b=EtSJMRy5j611HcPhgrgFfpsgmekuKGzD99W7Aj5vgv0SSqjc4mYwPSOPumqngM3+Dm9DBBP6wZD8RVHYbINrp6nAOOzU8sGnXxc95IRK/enBsS5ZgaB+WAG86PkMgJT3FqR9JDiwBcHMiLofPwPhT1VlBMKYd/dDZSlNt9TRpNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701207170; c=relaxed/simple; bh=TBXPVjKnAECpCj745LHePqzKwvLnH/hSkl+1An61lis=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=x/7ehiaGeSUZF9T1Xu2mvZG1UA9IMxMlKuzJZxo0uC9dtqK0XAIcc5VQ5T7eFk5lH99TY2z0pI+5Aw6VuMcgUwWMgthcd+LFCrkTr6+FDCDUShkcQV2mpoJ6vqXooe9rsY7FhnGHyJ2DIVKaV/dR5y+9XZl5KByUo7Zk7PMdxiI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701207169; 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=8/zYBwN1y6cwV/ShWFxSGDbVM8wAWrMmNcGCF8Tyk7U=; b=e6XU9EjXIfcNwNCgQe5R/WPBw4aCUBLR5YLDZGZ5vWnaSVu+/mqcNJtoPHihUGrBWTgClM tMYjXZoTByUlm4csLPjntGIeB2lpuCBzf5DZaU8hadb4SkaHlTcaGN3vrq3qZm10SrGpMz Pxd/b2ywVf+mIGPMxqpJwMJDZz0vcZU= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-427-jmLr9XP-Ni-cFBDsVa3PxA-1; Tue, 28 Nov 2023 16:32:48 -0500 X-MC-Unique: jmLr9XP-Ni-cFBDsVa3PxA-1 Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-58a8142a7a7so6280229eaf.3 for ; Tue, 28 Nov 2023 13:32:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701207167; x=1701811967; 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=8/zYBwN1y6cwV/ShWFxSGDbVM8wAWrMmNcGCF8Tyk7U=; b=lH1nke39O3Po4Z7AqdJDDeznfjbHoB8+vCNMY5k0mqUJC6w7sXAins4aPd+XjEudvK nYe2GUgzXq4Z4zkwYGxw0RTxM9gyJhwWkkzhydHCPGUz2BOGVIhAya7gCtu1QMC61YjH 6/hLEDRB9a1kugg5tOtcn8aGJjnp+1PGB+ebpZg6RVnlYoFZYN//+jqcf5Rz4cXXo5A1 HUsYXo/d0BgxaOgYbAIVVNJbeocZnwmo35D5shh/03TFSxnVMN5b2r1xmr0zsrdDKCGT bgDFeoKBKpOxA7nNHIuDBHpkt8OZ5H8j5Gnb2X4jKDIEHsItLcwceyTt5C2Od5vLn+w8 gT/Q== X-Gm-Message-State: AOJu0YyQzHxHWgF2/DZKYNxwfY6H/ztB/VoEG4efIONk01ISMdP2RGfH G+6G9Veg5PlumV09MxxKn+iBqx90pR8tmpl/UHGH3EgGTbdgGRqr9ILqglXACpO0SRAPMWNOVky EmvTVgR5WeFE8NsHFkw== X-Received: by 2002:a05:6820:1ac9:b0:58d:c5c5:c0e with SMTP id bu9-20020a0568201ac900b0058dc5c50c0emr576369oob.0.1701207167351; Tue, 28 Nov 2023 13:32:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhOxkvV4D+cYzQz9vN04HbOa4po11j4FFs0NJCrHTpOwldAZGBiQZNOzJ8txUtBlLYoUqmDw== X-Received: by 2002:a05:6820:1ac9:b0:58d:c5c5:c0e with SMTP id bu9-20020a0568201ac900b0058dc5c50c0emr576352oob.0.1701207167061; Tue, 28 Nov 2023 13:32:47 -0800 (PST) Received: from [192.168.1.145] (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 o62-20020a4a4441000000b0058a010374e6sm2075542ooa.39.2023.11.28.13.32.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Nov 2023 13:32:46 -0800 (PST) Message-ID: Date: Tue, 28 Nov 2023 16:32:45 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] c++: casting array prvalue [PR112658, PR94264] To: Patrick Palka , gcc-patches@gcc.gnu.org References: <20231128165112.2571430-1-ppalka@redhat.com> From: Jason Merrill In-Reply-To: <20231128165112.2571430-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=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,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/28/23 11:51, Patrick Palka wrote: > Bootstrapped and regtested on x86-64-pc-linux-gnu, does this look OK for > trunk? > > -- >8 -- > > Here we deem the array-to-pointer conversions in both calls as invalid, > but we fail to issue a diagnostic for the second call, ultimately because > cp_build_c_cast doesn't replay errors from build_const_cast_1. This means > the second call get silently discarded leading to wrong/unexpected code. > > This patch fixes this issue. I'm not sure if we want to accept these > conversions in the first place (that's PR94264 or at least related to > it), but at least we're more consistent now. I've now fixed that bug, thanks for the pointer. The cp_build_c_cast change is OK, but the testcase won't error anymore. Do you have an idea for an alternate test? If not, it's OK to apply the fix anyway. Jason