- /* Warn about initializer_list deduction that isn't currently in the
- working draft. */
- if (cxx_dialect > cxx98
- && flag_deduce_init_list
- && cand->template_decl
- && 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));
- tree patparm = get_pattern_parm (realparm, tmpl);
- tree pattype = TREE_TYPE (patparm);
- if (PACK_EXPANSION_P (pattype))
- pattype = PACK_EXPANSION_PATTERN (pattype);
- pattype = non_reference (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)),
- non_reference (type));
- pedwarn (DECL_SOURCE_LOCATION (cand->fn), 0,
- " in call to %qD", cand->fn);
- pedwarn (input_location, 0,
- " (you can disable this with "
- "%<-fno-deduce-init-list%>)");
- }
- }
-