]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/cp/typeck.c
CWG 2233 - default arg and parameter pack
[gcc.git] / gcc / cp / typeck.c
index 211696cf02957892b3af7d93036aa0e105872eab..24ca1b52410b85e41b0ed65492ee9458fa48caf7 100644 (file)
@@ -3835,6 +3835,10 @@ convert_arguments (tree typelist, vec<tree, va_gc> **values, tree fndecl,
        {
          for (; typetail != void_list_node; ++i)
            {
+             /* After DR777, with explicit template args we can end up with a
+                default argument followed by no default argument.  */
+             if (!TREE_PURPOSE (typetail))
+               break;
              tree parmval
                = convert_default_arg (TREE_VALUE (typetail),
                                       TREE_PURPOSE (typetail),
@@ -3850,9 +3854,10 @@ convert_arguments (tree typelist, vec<tree, va_gc> **values, tree fndecl,
                break;
            }
        }
-      else
+
+      if (typetail && typetail != void_list_node)
        {
-          if (complain & tf_error)
+         if (complain & tf_error)
            error_args_num (input_location, fndecl, /*too_many_p=*/false);
          return -1;
        }
This page took 0.032711 seconds and 5 git commands to generate.