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 81D0D3858C3A for ; Wed, 22 Nov 2023 21:53:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81D0D3858C3A 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 81D0D3858C3A 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=1700690042; cv=none; b=Igq0nq41PLaIU1BrnrzmE8TbDBcJDcsDQ9McTk79ROLEwGhKns+T3K8YhDC5y1u9MKpuXBPXWqrvWSVaDz5HmzvwjbFeramFYlXxPL5wpKJbrhRSv0YIU7PPybaQQcpdAPh3mihnK49v9S8Emoyan507XmD2QzrnbWzrSu/ft5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700690042; c=relaxed/simple; bh=fc0LdiuifhnWijqCRKdyOzj686bn8wHXE2DonYeQO0s=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Bi7FLeWmW6V5RSYR8J+FGSyouOzpUr/o8lvnJqN6l8LasByo2+SlAfASJEgep87Q9MX0+AVuq4c8IX339vKt3eng4xFNDmY+pk6cBecUdRUI++wDZxQ1lefsLeMeNOagcaDYLI3Z8vdw/91g0dobgYbyX5r/0g55aI+CPsSlyp4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700690032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rnRIlStCnvW0ULLjx+TPsVbwB0tkh0Q9CqWobbBDBkA=; b=LWrU2isuBSvscGmCSfw87O1AFKZKhrW+IIMKN+wMN+yi7UPNca1sZAmHRJQcvnRI1eRxrx Gogh8x7DI2xoquxW9VHfpUwuniRdaEPyIUZoCzYH3DQFrKCwfhcJC0xHSsR9mTZPNEQlfS VV0t+uaIzvAMT6ojMOeUXzDm1fKlbz0= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-mPDWsqJTNx6dixBHTio_9A-1; Wed, 22 Nov 2023 16:53:50 -0500 X-MC-Unique: mPDWsqJTNx6dixBHTio_9A-1 Received: by mail-ot1-f69.google.com with SMTP id 46e09a7af769-6d31f3feb10so271004a34.2 for ; Wed, 22 Nov 2023 13:53:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700690029; x=1701294829; h=content-transfer-encoding:in-reply-to:from:references:cc: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=rnRIlStCnvW0ULLjx+TPsVbwB0tkh0Q9CqWobbBDBkA=; b=tWzCXtWbfhQuMSBcE3H6r5pQ9kPyu2Dg3K7groO9GFO861IB0Jv9io3/Tbstu7++g2 Z+eTBU9D3LI5c39fQjpRdlJSROz7pB94exPlAtCAQm9ojCHh0HvGIsaf5JNMAhZtMXkY gA8F1DO8f8KHLcTqwz6xsogWZaNL8JCxcj1WlA25BEysiL8oB6T5iLTA8lrgn9GUER8u yP7nHzIVtI0XfZ1DrVyPQoi5zQOTuU2A7zX11J0BL2LcBBJ/WlYdg1ZqXuMyW8FbP4fu dG8nNH4vTNieJJJeCR6x8Wp+SDyix7dGZYc1KQ1svxyW49/VqIbZybGSpPPia8xRxGOx UjAw== X-Gm-Message-State: AOJu0Yz9sXhYLL1DABbD7Pd9bzaQwP1BS8qZjLVq38/YFVcvnzqPXKGQ IKqucTT1LnJjGUDRMZS9E0E2wnjMyXy9qK+GMXWSMnWJz9yca9e+O3TcxyaSkxufoHp9CA1R4m5 S648NbDmn4l1RMMYYDsQ2wWCJUA== X-Received: by 2002:a05:6870:f80c:b0:1f9:6f85:9650 with SMTP id fr12-20020a056870f80c00b001f96f859650mr4942260oab.2.1700690029600; Wed, 22 Nov 2023 13:53:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7Iv6ifeG18FsVwDv3PI14u1tSK1zxrmL4bVGsgYO+Jjt9CddO4kp1fcJunoMMKLpvGCIa6g== X-Received: by 2002:a05:6870:f80c:b0:1f9:6f85:9650 with SMTP id fr12-20020a056870f80c00b001f96f859650mr4942241oab.2.1700690029344; Wed, 22 Nov 2023 13:53:49 -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 z4-20020ac875c4000000b0041e383d527esm136474qtq.66.2023.11.22.13.53.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Nov 2023 13:53:48 -0800 (PST) Message-ID: Date: Wed, 22 Nov 2023 16:53:48 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++, v4: Implement C++26 P2741R3 - user-generated static_assert messages [PR110348] To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org References: <4b133eec-f806-43af-800a-8339d50645fd@redhat.com> <79a9ad09-2feb-4f3b-a4fe-1d13293fcd8b@redhat.com> From: Jason Merrill In-Reply-To: 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/22/23 05:00, Jakub Jelinek wrote: > On Tue, Nov 21, 2023 at 10:51:36PM -0500, Jason Merrill wrote: >> Actually, let's go back to the previous message, but change the tf_nones >> above to 'complain' so that we see those errors and then this explanation. >> Likewise with the conversion checks later in the function. > > So like this? > Besides what you asked for I've separated the diagnostics for when size > member isn't found in lookup vs. when data isn't found, because it looked > weird to get 2 same errors e.g. in the udlit-error1.C case. > > + message_sz > + = finish_class_member_access_expr (message, > + get_identifier ("size"), > + false, complain); > + if (message_sz == error_mark_node) > + { > + error_at (location, "% message must be a string " > + "literal or object with % and " > + "% members"); > + return; > + } > + message_data > + = finish_class_member_access_expr (message, > + get_identifier ("data"), > + false, complain); > + if (message_data == error_mark_node) > + { > + error_at (location, "% message must be a string " > + "literal or object with % and " > + "% members"); > + return; > + } I agree it's weird to get two of the same error, but maybe instead of duplicating the error, we could look up data only if size succeeded, and then error once if either failed? OK with that change. Jason