public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ARM/heads/morello)] cp: Allow INTCAP_TYPEs as non-type template parameters
@ 2022-10-04 10:03 Alex Coplan
0 siblings, 0 replies; only message in thread
From: Alex Coplan @ 2022-10-04 10:03 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:ee3f16b654780d3333e1b94bb373dc134ab782c3
commit ee3f16b654780d3333e1b94bb373dc134ab782c3
Author: Alex Coplan <alex.coplan@arm.com>
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() {}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-04 10:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 10:03 [gcc(refs/vendors/ARM/heads/morello)] cp: Allow INTCAP_TYPEs as non-type template parameters Alex Coplan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).