aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C
new file mode 100644
index 00000000000..ad24da9cb47
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr88395.C
@@ -0,0 +1,23 @@
+// { dg-do compile { target c++2a } }
+
+template <class T, class U>
+concept Concept2 = requires (T t, U u)
+{
+ t += u; // { dg-error "template instantiation depth" }
+};
+
+template <class T>
+concept Concept = Concept2 <T, T>;
+
+struct S
+{
+ template <Concept T>
+ constexpr S& operator += (T o);
+};
+
+constexpr S operator * (S a, S b)
+{
+ return a += b;
+}
+
+// { dg-prune-output "compilation terminated" }