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 E6A753857B9C for ; Mon, 15 Jan 2024 21:00:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E6A753857B9C 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 E6A753857B9C 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=1705352420; cv=none; b=Ad0OLbTqe78YHGFSL2W92lvMi2ewmtMQwzby2GHin6UTnzWvGxO5f9gs38P9HeZjq6jIGETZc1cN/G2qRo2D3Olsp/l/T/xUIfPDDYZ6RzqWqHybyV2sFPdsCPTqYupjLhu0vJc+hEKYOPu3KkTO546ZAdcBnJ+Apz8r5IpPdm8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705352420; c=relaxed/simple; bh=ftvYRvFjotck2rtMHt3Oq2qpwC/tQ4B7MzRiV1i87l8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=mXDoJ6lcpvInXvoVRwo38/5DI8iySXeP3f7Yr/ha+z8YE5ew1sPe2yrT5DPGFSKUgQmtzknggtLzNCqf826gpTTNlITet3VIMqLZfhZxlpvr1yUfGzgr7fVPUVpUrjfMYkfgCwmqLhgff/butrYnqUklS8ACH98enltu/0NIRL4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705352418; 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=JFuHENVnYmamoEbPGpRmery/fT9z/Tf+EOwncIislhQ=; b=OUdhDBgTcr/fZRU8wyMgij4CZXV/qINmwzjK8LAGLzi/YQoDfWWhoPOAY7YXuGNsaorsHG lM2cGtWyKtkmaNd/LPxl513/JtoumL4l1ob1GHrA3+DPVhOKGLr1VF/bSfd1qK8xGldUZj tZ34W7ZEe2sFBo6k8wUcO5+uv4g+RMU= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-29-5luU_ZbKN4mUe-2gVbl0dA-1; Mon, 15 Jan 2024 16:00:16 -0500 X-MC-Unique: 5luU_ZbKN4mUe-2gVbl0dA-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-680139b198aso199548566d6.3 for ; Mon, 15 Jan 2024 13:00:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705352416; x=1705957216; 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=JFuHENVnYmamoEbPGpRmery/fT9z/Tf+EOwncIislhQ=; b=LdeYMZ6rzIvqj7YO285vNz2gR0KXyPeiBw95OjGKEWYkxtVYMXGTUJ1TPyYpSreP0m H2qY8ltJoNZHXZIxZvv/FgaknnE2NWdx+K0ewCJViSdxUPA1X3yPE87PtGI6AF2dUp89 GnWCakU8z9rqOLRIJrI+3xba4pnlPFpXFFKWw78UoTJ+nmrbSoDTVaQFty3FlPy5VVAU IDfyVKdk8+xs/Zw9MgnIu1SrZSs/vagTlS80i+1Ter/H/EyUGvcaPwogVQSWvPbsvf4e H8DunU1giYCa6nTpA01tsBoUnj+UigL00vTQD4aWTpCSZAKHoByvvO2fxYIUKM9wLRlq KMgg== X-Gm-Message-State: AOJu0Yy0b/p20Diq+pOVSaHk9DTZ8s5I7jjwzLbH30qRtFPXtw5gGVYu wPLulmf85Prz0/JBKhPRBltoad+nr2+ANxIZOdvtOCleipunERpkHrifZBFX83iIaqAsqHMBbmj V7nXy4iMggEaxek7s9hUzIbgOoABS5fLLNg== X-Received: by 2002:ad4:574c:0:b0:680:cc64:5e6b with SMTP id q12-20020ad4574c000000b00680cc645e6bmr8927755qvx.3.1705352416243; Mon, 15 Jan 2024 13:00:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEC5vKg6xpZyWpo4imSLUtfJl4h9G+5qvrfACW0EkDlfqwpMDrAl6weSxSIL+eiE14lWXhFwg== X-Received: by 2002:ad4:574c:0:b0:680:cc64:5e6b with SMTP id q12-20020ad4574c000000b00680cc645e6bmr8927744qvx.3.1705352415972; Mon, 15 Jan 2024 13:00:15 -0800 (PST) Received: from [192.168.1.146] (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 w12-20020a0ce10c000000b0067f70cc986asm3612840qvk.92.2024.01.15.13.00.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jan 2024 13:00:15 -0800 (PST) Message-ID: Date: Mon, 15 Jan 2024 16:00:14 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++: address of NTTP object as targ [PR113242] To: Patrick Palka , gcc-patches@gcc.gnu.org References: <20240105165056.571235-1-ppalka@redhat.com> From: Jason Merrill In-Reply-To: <20240105165056.571235-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=-12.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,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 1/5/24 11:50, Patrick Palka wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK > for trunk and perhaps 13? > > -- >8 -- > > invalid_tparm_referent_p was rejecting using the address of a class NTTP > object as a template argument, but this should be fine. Hmm, I suppose so; https://eel.is/c++draft/temp#param-8 saying "No two template parameter objects are template-argument-equivalent" suggests there can be only one. And clang/msvc allow it. > PR c++/113242 > > gcc/cp/ChangeLog: > > * pt.cc (invalid_tparm_referent_p) : Suppress > DECL_ARTIFICIAL rejection test for class NTTP objects. > > gcc/testsuite/ChangeLog: > > * g++.dg/cpp2a/nontype-class61.C: New test. > --- > gcc/cp/pt.cc | 3 ++- > gcc/testsuite/g++.dg/cpp2a/nontype-class61.C | 27 ++++++++++++++++++++ > 2 files changed, 29 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/g++.dg/cpp2a/nontype-class61.C > > diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc > index 154ac76cb65..8c7d178328d 100644 > --- a/gcc/cp/pt.cc > +++ b/gcc/cp/pt.cc > @@ -7219,7 +7219,8 @@ invalid_tparm_referent_p (tree type, tree expr, tsubst_flags_t complain) > * a string literal (5.13.5), > * the result of a typeid expression (8.2.8), or > * a predefined __func__ variable (11.4.1). */ > - else if (VAR_P (decl) && DECL_ARTIFICIAL (decl)) > + else if (VAR_P (decl) && !DECL_NTTP_OBJECT_P (decl) > + && DECL_ARTIFICIAL (decl)) If now some artificial variables are OK and others are not, perhaps we should enumerate them either way and abort if it's one we haven't specifically considered. Jason