summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/concepts/template-parm4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/concepts/template-parm4.C')
-rw-r--r--gcc/testsuite/g++.dg/concepts/template-parm4.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/concepts/template-parm4.C b/gcc/testsuite/g++.dg/concepts/template-parm4.C
new file mode 100644
index 00000000000..a29bb11a679
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/template-parm4.C
@@ -0,0 +1,20 @@
+// { dg-options "-std=c++1z" }
+
+template<typename T>
+ concept bool C1 = __is_same_as(T, int);
+
+template<int N>
+ concept bool C2 = N == 0;
+
+template<template<typename> class X>
+ concept bool C3 = false;
+
+template<typename> struct Foo;
+
+template<C1... Ts> struct S1 { };
+template<C2... Ns> struct S2 { };
+template<C3... Xs> struct S3 { };
+
+S1<int, int, bool> s1; // { dg-error "constraint failure|invalid type" }
+S2<0, 1, 2> s2; // { dg-error "constraint failure|invalid type" }
+S3<Foo> s3; // { dg-error "constraint failure|invalid type" }