aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C
new file mode 100644
index 00000000000..d76f12eb209
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-recursive-sat2.C
@@ -0,0 +1,15 @@
+// { dg-do compile { target c++2a } }
+
+template<typename T>
+concept Fooable = requires(T t) { foo(t); }; // { dg-error "template instantiation depth" }
+
+template<Fooable T>
+void foo(T t) { }
+
+void test()
+{
+ struct S {} s;
+ foo(s);
+}
+
+// { dg-prune-output "compilation terminated" }