diff options
Diffstat (limited to 'gcc/cp')
| -rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cp/pt.c | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ecc83b4..d2b2dbe 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2009-02-23 Jason Merrill <jason@redhat.com> + + * pt.c (unify): Call maybe_adjust_types_for_deduction when + deducing from an initializer list. + 2009-02-20 Jason Merrill <jason@redhat.com> PR c++/39225 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; |
