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 80FA13858D1E for ; Mon, 5 Feb 2024 15:14:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 80FA13858D1E 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 80FA13858D1E 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=1707146079; cv=none; b=OHPXMzGWXFYF8VM7ACq8UVWGJjzmoHoKPMuPWOGn0/PDRw0aQn5z8y5kETFAPsKNB+D2fjLMldgYP3oA8XL8rtsgPiDca8u3reM5SLekamMflvmAqiTlWKML20Jf3mYeDfmUYVpuXB4hqcf4J0qePhBAqafA4yOnnvFZ88qW3js= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707146079; c=relaxed/simple; bh=dXsVW+0z3iV0ek5ZVoceQDtWPh2SYIPby3F4uay3Dw8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=GltdfnltFzRKjkgbOMSJye8oo7fX1Fs1RVr/nyVgpT3QUMSYgwhszvgKvoObsW3i9RfCiYQIj1uavLcm0Lv7Pvceh6wGow2HWt8hsoh1qKjLoqO3c7eSUXOrx/LWOk0l61SF/Sf5PSRixwaTeA3uRw2qV+XvvoWkLn25vVAU54M= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707146078; 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=A2Ss8qxCxVkD8K3HcbKuH61MwVJH64Q1XRS4KKf4ceg=; b=AFBcjVDZNJCfoLcUAMeUZwiHnOJMFU4i5LWSneX8dwOsjEjAD/hcVjO3FLR5Omd6vtTJx7 CxZyGuvBKNsSCy1qJ45QyedXSDVTuoPwxs0wg/3bBjsveqLhcQhhiv9psrjmrmZk+Hy1xe mp15Q6JdKYgmDoGQZlD8SYBsXyxoGYY= 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-546-ryd_VOSWPjiuz--hEpQEHA-1; Mon, 05 Feb 2024 10:14:36 -0500 X-MC-Unique: ryd_VOSWPjiuz--hEpQEHA-1 Received: by mail-ot1-f69.google.com with SMTP id 46e09a7af769-6e11a5b2f04so4690030a34.0 for ; Mon, 05 Feb 2024 07:14:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707146076; x=1707750876; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=A2Ss8qxCxVkD8K3HcbKuH61MwVJH64Q1XRS4KKf4ceg=; b=ia5viZNLiYY4Mb4HsJ9AtO1KotiX0aFJx+J7K+CPSQNvsM7hU0EGfbVlTHE185C4pB f2hzBsIUsFgaqVVD3qcfmDSd3egpQEu/5iL0RTHu6cDYlV4Kt4SAKyHLC5302RSQWMId hT4A9Myf/hfbfhRh3e7SrrHbkVVVBIDQNlP7h/WUgZgQinePhUb+7B6l4B0m5s2zuNv4 JuZKzSopLu9lVCH8zVvbzUjYOq6nmLLV1LUy3Ub6FtMTXD8kh4Qe1l9DHJCkGyON+/J7 DDlip3FcDsnbUpOH6oW75RlHrLGNO+qe32gXh+O3fW8Zk0sEZrjaf+kHNPCqdIEDsYAD 7weQ== X-Gm-Message-State: AOJu0Yxfywr9qeLL+AkTYlTJjVdnVntRjf7m6HOG49lgK2LZ+jzsb2BF M23xVZqWtF2NT0eimoONoDvrLNpjJitfZ3KDeFVTSnXcH4MOpNkUO+E9/HjjthmCuv+IDut3OhV SJGxPu2roVcIMEJfNPTyZheHqgPSVExnHVlFKAfOqrYaptEK6HfsF2AM= X-Received: by 2002:a05:6871:5c8:b0:219:2865:24c7 with SMTP id v8-20020a05687105c800b00219286524c7mr8162350oan.42.1707146076243; Mon, 05 Feb 2024 07:14:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7HEJ9czKTghRE0XL6mkHi3zKfm233ZvffkF4LhU55sceQEvoc+i+GylZTvROrC0LzNFsosw== X-Received: by 2002:a05:6871:5c8:b0:219:2865:24c7 with SMTP id v8-20020a05687105c800b00219286524c7mr8162334oan.42.1707146075948; Mon, 05 Feb 2024 07:14:35 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVVC3/RpvhEqPVo4ug+7qehTkwcl6dxci1liWSv0+Fia0RKMR4C5Mp7jzfiMaMA71fV++vaWWZq+HR/drivCGXghaG47yNsLw== Received: from [192.168.1.130] (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 w15-20020a0cef8f000000b0068c89047955sm45215qvr.112.2024.02.05.07.14.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Feb 2024 07:14:35 -0800 (PST) Message-ID: <69077fcc-97fe-43be-9e34-9d91d1a7c7af@redhat.com> Date: Mon, 5 Feb 2024 10:14:34 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++: DR2237, cdtor and template-id tweaks [PR107126] To: Marek Polacek , GCC Patches References: <20240203152404.1199437-1-polacek@redhat.com> From: Jason Merrill In-Reply-To: <20240203152404.1199437-1-polacek@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.4 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_H5,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 2/3/24 10:24, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > I'm not certain OPT_Wc__20_extensions is the best thing for something > from [diff.cpp17]; would you prefer something else? I think it wants its own flag, that is enabled in C++20 or by -Wc++20-compat. > + if (cxx_dialect >= cxx20) > + { > + if (!cp_parser_simulate_error (parser)) > + pedwarn (tilde_loc, OPT_Wc__20_extensions, > + "template-id not allowed for destructor"); > + return error_mark_node; > + } > + warning_at (tilde_loc, OPT_Wc__20_compat, > + "template-id not allowed for destructor in C++20"); After a pedwarn we should accept the code, not return error_mark_node. I'm also concerned about pedwarn/warnings not guarded by !cp_parser_uncommited_to_tentative_parse; that often leads to warning about a tentative parse as a declaration that is eventually abandoned in favor of a perfectly fine parse as an expression. It would be good for cp_parser_context to add a vec of warnings to emit at cp_parser_parse_definitely time, and then cp_parser_pedwarn/cp_parser_warning to fill it... Jason