This was simple enough to backport even though it's concepts.
gcc/cp/ChangeLog
2020-03-05 Jason Merrill <jason@redhat.com>
PR c++/88395
PR c++/93551
* constraint.cc (constraints_satisfied_p): Use push_tinst_level.
+2020-03-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/88395
+ PR c++/93551
+ * constraint.cc (constraints_satisfied_p): Use push_tinst_level.
+
2020-03-05 Martin Sebor <msebor@redhat.com>
Backport from trunk.
ci = get_constraints (decl);
}
+ if (!push_tinst_level (decl))
+ return true;
tree eval = satisfy_associated_constraints (ci, args);
+ pop_tinst_level ();
+
return eval == boolean_true_node;
}
--- /dev/null
+// { dg-options "-std=c++17 -fconcepts" }
+
+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" }