* pt.c (push_tinst_level_loc): Set at_eof before fatal_error.
From-SVN: r238387
2016-07-15 Jason Merrill <jason@redhat.com>
+ PR c++/71718
+ * pt.c (push_tinst_level_loc): Set at_eof before fatal_error.
+
PR c++/70824
* init.c (constant_value_1): Don't instantiated DECL_INITIAL of
artificial variables.
if (tinst_depth >= max_tinst_depth)
{
+ /* Tell error.c not to try to instantiate any templates. */
+ at_eof = 2;
fatal_error (input_location,
"template instantiation depth exceeds maximum of %d"
" (use -ftemplate-depth= to increase the maximum)",
--- /dev/null
+// PR c++/71718
+// { dg-do compile { target c++11 } }
+
+template <typename T>
+class A : T{};
+
+template <typename T>
+using sp = A<T>;
+
+struct Base {};
+
+template <typename T, int num = 1>
+const sp<T>
+rec() // { dg-error "depth" }
+{
+ return rec<T, num - 1>();
+}
+
+static void f(void) {
+ rec<Base>();
+}
+
+// { dg-prune-output "compilation terminated" }