@@ -5101,7 +5101,7 @@ static void
fixed_parameter_pack_p_1 (tree parm, struct find_parameter_pack_data *ppd)
{
/* A type parm can't refer to another parm. */
- if (TREE_CODE (parm) == TYPE_DECL)
+ if (TREE_CODE (parm) == TYPE_DECL || parm == error_mark_node)
return;
else if (TREE_CODE (parm) == PARM_DECL)
{
@@ -0,0 +1,9 @@
+// PR c++/85147
+// { dg-do compile { target c++11 } }
+
+template<typename T> struct A
+{
+ template<template<...T> class...> struct B {}; // { dg-error "expected|mismatch" }
+};
+
+A<int>::B<> b; // { dg-error "does not name a template type" }