summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 7814448b608..33e74049850 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -15441,13 +15441,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);
@@ -15460,24 +15466,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]: