===================================================================
@@ -24513,7 +24513,7 @@ cp_parser_cache_defarg (cp_parser *parser, bool ns
case CPP_CLOSE_SQUARE:
if (depth == 0
/* Handle correctly int n = sizeof ... ( p ); */
- && !(nsdmi && token->type == CPP_ELLIPSIS))
+ && token->type != CPP_ELLIPSIS)
done = true;
/* Update DEPTH, if necessary. */
else if (token->type == CPP_CLOSE_PAREN
===================================================================
@@ -0,0 +1,15 @@
+// PR c++/59435
+// { dg-require-effective-target c++11 }
+
+template <typename... E>
+struct T
+{
+ T(unsigned int i = sizeof...(E)){} // does not compile
+
+ static constexpr unsigned int U = sizeof...(E);
+ T(unsigned int j, unsigned int i = U){} // compile
+};
+
+template <typename... T>
+void test(int i = sizeof...(T)) // compile
+{}