===================================================================
@@ -24145,7 +24145,9 @@ cp_parser_cache_defarg (cp_parser *parser, bool ns
case CPP_SEMICOLON:
case CPP_CLOSE_BRACE:
case CPP_CLOSE_SQUARE:
- if (depth == 0)
+ if (depth == 0
+ /* Handle correctly int n = sizeof ... ( p ); */
+ && !(nsdmi && token->type == CPP_ELLIPSIS))
done = true;
/* Update DEPTH, if necessary. */
else if (token->type == CPP_CLOSE_PAREN
===================================================================
@@ -0,0 +1,7 @@
+// PR c++/57673
+// { dg-do compile { target c++11 } }
+
+template< int ... p >
+struct d {
+ int n = sizeof ... ( p );
+};