* call.c (convert_like_real): Don't call build_value_init in template.
* g++.dg/cpp0x/initlist-value4.C: New test.
From-SVN: r269267
+2019-02-27 Marek Polacek <polacek@redhat.com>
+
+ PR c++/88857 - ICE with value-initialization of argument in template.
+ * call.c (convert_like_real): Don't call build_value_init in template.
+
2019-02-27 Jason Merrill <jason@redhat.com>
PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
/* If we're initializing from {}, it's value-initialization. */
if (BRACE_ENCLOSED_INITIALIZER_P (expr)
&& CONSTRUCTOR_NELTS (expr) == 0
- && TYPE_HAS_DEFAULT_CONSTRUCTOR (totype))
+ && TYPE_HAS_DEFAULT_CONSTRUCTOR (totype)
+ && !processing_template_decl)
{
bool direct = CONSTRUCTOR_IS_DIRECT_INIT (expr);
if (abstract_virtuals_error_sfinae (NULL_TREE, totype, complain))
+2019-02-27 Marek Polacek <polacek@redhat.com>
+
+ PR c++/88857 - ICE with value-initialization of argument in template.
+ * g++.dg/cpp0x/initlist-value4.C: New test.
+
2019-02-27 Marek Polacek <polacek@redhat.com>
PR c++/89511 - ICE with using-declaration and unscoped enumerator.
--- /dev/null
+// PR c++/88857
+// { dg-do compile { target c++11 } }
+
+class S { int a; };
+void foo (const S &, int);
+
+template <int N>
+void
+bar ()
+{
+ foo ({}); // { dg-error "too few arguments to function" }
+}