aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 81eaffe..7246b13 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -13204,9 +13204,18 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (arg), i, elt)
{
+ int elt_strict = strict;
if (!BRACE_ENCLOSED_INITIALIZER_P (elt))
- elt = TREE_TYPE (elt);
- if (unify (tparms, targs, elttype, elt, UNIFY_ALLOW_NONE))
+ {
+ tree type = TREE_TYPE (elt);
+ /* It should only be possible to get here for a call. */
+ gcc_assert (elt_strict & UNIFY_ALLOW_OUTER_LEVEL);
+ elt_strict |= maybe_adjust_types_for_deduction
+ (DEDUCE_CALL, &elttype, &type, elt);
+ elt = type;
+ }
+
+ if (unify (tparms, targs, elttype, elt, elt_strict))
return 1;
}
return 0;