+2019-09-04 Marek Polacek <polacek@redhat.com>
+
+ * doc/invoke.texi: Remove -fdeduce-init-list documentation.
+
2019-09-04 Uroš Bizjak <ubizjak@gmail.com>
PR target/32413
+2019-09-04 Marek Polacek <polacek@redhat.com>
+
+ * c.opt (fdeduce-init-list): Ignored.
+
2019-09-04 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR c/78736
Emit debug annotations during preprocessing.
fdeduce-init-list
-C++ ObjC++ Var(flag_deduce_init_list) Init(0)
--fdeduce-init-list enable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list.
+C++ ObjC++ Ignore
+Does nothing. Preserved for backward compatibility.
fdeclone-ctor-dtor
C++ ObjC++ Var(flag_declone_ctor_dtor) Init(-1)
+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.
&& !(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. */
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
evaluation might take too long.
The default is 33554432 (1<<25).
-@item -fdeduce-init-list
-@opindex fdeduce-init-list
-Enable deduction of a template type parameter as
-@code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
-
-@smallexample
-template <class T> auto forward(T t) -> decltype (realfn (t))
-@{
- return realfn (t);
-@}
-
-void f()
-@{
- forward(@{1,2@}); // call forward<std::initializer_list<int>>
-@}
-@end smallexample
-
-This deduction was implemented as a possible extension to the
-originally proposed semantics for the C++11 standard, but was not part
-of the final standard, so it is disabled by default. This option is
-deprecated, and may be removed in a future version of G++.
-
@item -fno-elide-constructors
@opindex fno-elide-constructors
@opindex felide-constructors
+2019-09-04 Marek Polacek <polacek@redhat.com>
+
+ * g++.dg/cpp0x/initlist-deduce.C: Don't use -fdeduce-init-list. Remove
+ dg-warning. Add dg-error.
+
2019-09-04 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR c/78736
-// Test for deduction of T as std::initializer_list. This isn't currently
-// supported by the working draft, but is necessary for perfect forwarding
-// of initializer-lists to things that can take a std::initializer_list.
-
-// { dg-options "-fdeduce-init-list" }
-// { dg-do run { target c++11 } }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
void f (A a) { }
template <class T>
-auto g (T&& t) -> decltype (f(t)) // { dg-warning "call" }
+auto g (T&& t) -> decltype (f(t))
{
return f(t);
}
int main()
{
- g({1}); // { dg-warning "deduc" }
+ g({1}); // { dg-error "no matching function" }
}
-// { dg-prune-output "-fno-deduce-init-list" }