From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7810) id 51A91385841F; Tue, 4 Oct 2022 10:03:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51A91385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664877813; bh=QyjvNzG6JQCrz7bhPWw8uYkrFHj0In7CzYD7P9XTwZk=; h=From:To:Subject:Date:From; b=QuYPhFw8ngVzODDiY9g4IgLmpiCX1Tc23u9A5IMnC4EeZ0g/5YP6CYXUmLaSj5mgn YTTaDyYhRw4vKF1EG5xfdve+4mWKlc5papn8RMknZfRxEHuIpEhg9Zq1PXcsqsI7pb AGFvjFHtIb9A2OtdGfB+YENkHgwx7Fd43naY13gQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alex Coplan To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] cp: Allow INTCAP_TYPEs as non-type template parameters X-Act-Checkin: gcc X-Git-Author: Alex Coplan X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: 46c0f36ba7dc0c1d8d992f6ccfe24b7f863b5688 X-Git-Newrev: ee3f16b654780d3333e1b94bb373dc134ab782c3 Message-Id: <20221004100333.51A91385841F@sourceware.org> Date: Tue, 4 Oct 2022 10:03:33 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ee3f16b654780d3333e1b94bb373dc134ab782c3 commit ee3f16b654780d3333e1b94bb373dc134ab782c3 Author: Alex Coplan Date: Mon Sep 26 11:09:24 2022 +0100 cp: Allow INTCAP_TYPEs as non-type template parameters It looks like we missed updating pt.c:invalid_nontype_parm_type_p to allow INTCAP_TYPEs as non-type template parameters, this fixes that. gcc/cp/ChangeLog: * pt.c (invalid_nontype_parm_type_p): Also allow INTCAP_TYPEs. gcc/testsuite/ChangeLog: * g++.target/aarch64/morello/intcap-nontype-template.C: New test. Diff: --- gcc/cp/pt.c | 2 ++ gcc/testsuite/g++.target/aarch64/morello/intcap-nontype-template.C | 3 +++ 2 files changed, 5 insertions(+) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 3b1d4816659..9957c11034f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -26222,6 +26222,8 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain) { if (INTEGRAL_OR_ENUMERATION_TYPE_P (type)) return false; + else if (INTCAP_TYPE_P (type)) + return false; else if (TYPE_PTR_P (type)) return false; else if (TYPE_REF_P (type) diff --git a/gcc/testsuite/g++.target/aarch64/morello/intcap-nontype-template.C b/gcc/testsuite/g++.target/aarch64/morello/intcap-nontype-template.C new file mode 100644 index 00000000000..02731c6c7a6 --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/morello/intcap-nontype-template.C @@ -0,0 +1,3 @@ +/* { dg-do compile } */ +template<__intcap v> +void f() {}