diff options
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index a21522b3510..1b3f039cc6d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15333,13 +15333,19 @@ type_unification_real (tree tparms, ? tf_warning_or_error : tf_none); - /* Check to see if we need another pass before we start clearing - ARGUMENT_PACK_INCOMPLETE_P. */ for (i = 0; i < ntparms; i++) { tree targ = TREE_VEC_ELT (targs, i); tree tparm = TREE_VEC_ELT (tparms, i); + /* Clear the "incomplete" flags on all argument packs now so that + substituting them into later default arguments works. */ + if (targ && ARGUMENT_PACK_P (targ)) + { + ARGUMENT_PACK_INCOMPLETE_P (targ) = 0; + ARGUMENT_PACK_EXPLICIT_ARGS (targ) = NULL_TREE; + } + if (targ || tparm == error_mark_node) continue; tparm = TREE_VALUE (tparm); @@ -15352,24 +15358,6 @@ type_unification_real (tree tparms, && uses_template_parms (TREE_TYPE (tparm)) && !saw_undeduced++) goto again; - } - - for (i = 0; i < ntparms; i++) - { - tree targ = TREE_VEC_ELT (targs, i); - tree tparm = TREE_VEC_ELT (tparms, i); - - /* Clear the "incomplete" flags on all argument packs now so that - substituting them into later default arguments works. */ - if (targ && ARGUMENT_PACK_P (targ)) - { - ARGUMENT_PACK_INCOMPLETE_P (targ) = 0; - ARGUMENT_PACK_EXPLICIT_ARGS (targ) = NULL_TREE; - } - - if (targ || tparm == error_mark_node) - continue; - tparm = TREE_VALUE (tparm); /* Core issue #226 (C++0x) [temp.deduct]: |