indicated by the CONVERSION_PATH. */
tree conversion_path;
tree template_decl;
+ tree explicit_targs;
candidate_warning *warnings;
z_candidate *next;
};
cand->template_decl = build_template_info (tmpl, targs);
else
cand->template_decl = DECL_TEMPLATE_INFO (fn);
+ cand->explicit_targs = explicit_targs;
return cand;
fail:
parm = TREE_CHAIN (parm), ++arg_index, ++i)
{
tree type = TREE_VALUE (parm);
+ tree arg = VEC_index (tree, args, arg_index);
conv = convs[i];
if (cxx_dialect > cxx98
&& flag_deduce_init_list
&& cand->template_decl
- && is_std_init_list (non_reference (type)))
+ && is_std_init_list (non_reference (type))
+ && BRACE_ENCLOSED_INITIALIZER_P (arg))
{
tree tmpl = TI_TEMPLATE (cand->template_decl);
tree realparm = chain_index (j, DECL_ARGUMENTS (cand->fn));
pattype = PACK_EXPANSION_PATTERN (pattype);
pattype = non_reference (pattype);
- if (!is_std_init_list (pattype))
+ if (TREE_CODE (pattype) == TEMPLATE_TYPE_PARM
+ && (cand->explicit_targs == NULL_TREE
+ || (TREE_VEC_LENGTH (cand->explicit_targs)
+ <= TEMPLATE_TYPE_IDX (pattype))))
{
pedwarn (input_location, 0, "deducing %qT as %qT",
non_reference (TREE_TYPE (patparm)),
}
}
- val = convert_like_with_context
- (conv, VEC_index (tree, args, arg_index), fn, i - is_method,
- complain);
+ val = convert_like_with_context (conv, arg, fn, i-is_method, complain);
val = convert_for_arg_passing (type, val);
if (val == error_mark_node)