diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/call.c | 32 | ||||
-rw-r--r-- | gcc/cp/pt.c | 5 |
3 files changed, 5 insertions, 37 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8eb81c5..605b3d7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-09-04 Marek Polacek <polacek@redhat.com> + + * call.c (build_over_call): Remove -fdeduce-init-list implementation. + * pt.c (unify): Likewise. + 2019-09-01 Marek Polacek <polacek@redhat.com> PR c++/91129 - wrong error with binary op in template argument. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 01a25ad..c3045d9 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -8337,38 +8337,6 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) && !(flags & LOOKUP_EXPLICIT_TMPL_ARGS)) conversion_warning = false; - /* 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%>)"); - } - } - /* Set user_conv_p on the argument conversions, so rvalue/base handling knows not to allow any more UDCs. This needs to happen after we process cand->warnings. */ diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 187f9d85..15cc4b2 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -22073,11 +22073,6 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict, unsigned i; tree orig_parm = parm; - /* Replace T with std::initializer_list<T> for deduction. */ - if (TREE_CODE (parm) == TEMPLATE_TYPE_PARM - && flag_deduce_init_list) - parm = listify (parm); - if (!is_std_init_list (parm) && TREE_CODE (parm) != ARRAY_TYPE) /* We can only deduce from an initializer list argument if the |