diff options
author | Jason Merrill <jason@redhat.com> | 2011-08-16 19:26:08 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-08-16 19:26:08 -0400 |
commit | fd4198e6b89d8ccac63ff4112525bcf3ca7cf6f9 (patch) | |
tree | ba733e38b71113e12935d59050197a2299484125 /gcc/cp | |
parent | 41669f514908961e5d3e9bf83cc761397c2e00b8 (diff) | |
download | gcc-fd4198e6b89d8ccac63ff4112525bcf3ca7cf6f9.zip gcc-fd4198e6b89d8ccac63ff4112525bcf3ca7cf6f9.tar.gz gcc-fd4198e6b89d8ccac63ff4112525bcf3ca7cf6f9.tar.bz2 |
re PR c++/50086 ([C++0x] Error on lookup of template function address with variadic template arguments)
PR c++/50086
* pt.c (unify_pack_expansion): Correct overloaded unification
logic.
From-SVN: r177813
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 33 |
2 files changed, 17 insertions, 20 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c06a307..4d6c353 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2011-08-16 Jason Merrill <jason@redhat.com> + PR c++/50086 + * pt.c (unify_pack_expansion): Correct overloaded unification + logic. + * pt.c (instantiate_class_template_1): If DECL_PRESERVE_P is set on a member function or static data member, call mark_used. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9a4419a..9ab110a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15434,7 +15434,6 @@ unify_pack_expansion (tree tparms, tree targs, tree packed_parms, tree arg = TREE_VEC_ELT (packed_args, i); tree arg_expr = NULL_TREE; int arg_strict = strict; - bool skip_arg_p = false; if (call_args_p) { @@ -15477,19 +15476,15 @@ unify_pack_expansion (tree tparms, tree targs, tree packed_parms, if (resolve_overloaded_unification (tparms, targs, parm, arg, (unification_kind_t) strict, - sub_strict, explain_p) - != 0) - return 1; - skip_arg_p = true; + sub_strict, explain_p)) + goto unified; + return unify_overload_resolution_failure (explain_p, arg); } - if (!skip_arg_p) - { - arg_expr = arg; - arg = unlowered_expr_type (arg); - if (arg == error_mark_node) - return 1; - } + arg_expr = arg; + arg = unlowered_expr_type (arg); + if (arg == error_mark_node) + return unify_invalid (explain_p); } arg_strict = sub_strict; @@ -15500,16 +15495,14 @@ unify_pack_expansion (tree tparms, tree targs, tree packed_parms, &parm, &arg, arg_expr); } - if (!skip_arg_p) - { - /* For deduction from an init-list we need the actual list. */ - if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr)) - arg = arg_expr; - RECUR_AND_CHECK_FAILURE (tparms, targs, parm, arg, arg_strict, - explain_p); - } + /* For deduction from an init-list we need the actual list. */ + if (arg_expr && BRACE_ENCLOSED_INITIALIZER_P (arg_expr)) + arg = arg_expr; + RECUR_AND_CHECK_FAILURE (tparms, targs, parm, arg, arg_strict, + explain_p); } + unified: /* For each parameter pack, collect the deduced value. */ for (pack = packs; pack; pack = TREE_CHAIN (pack)) { |