+2019-02-13 Marek Polacek <polacek@redhat.com>
+
+ PR c++/89297 - ICE with OVERLOAD in template.
+ * semantics.c (finish_compound_literal): Call
+ instantiate_non_dependent_expr_sfinae.
+
2019-02-13 Alexandre Oliva <aoliva@redhat.com>
PR c++/86379
return error_mark_node;
compound_literal = reshape_init (type, compound_literal, complain);
if (SCALAR_TYPE_P (type)
- && !BRACE_ENCLOSED_INITIALIZER_P (compound_literal)
- && !check_narrowing (type, compound_literal, complain))
- return error_mark_node;
+ && !BRACE_ENCLOSED_INITIALIZER_P (compound_literal))
+ {
+ tree t = instantiate_non_dependent_expr_sfinae (compound_literal,
+ complain);
+ if (!check_narrowing (type, t, complain))
+ return error_mark_node;
+ }
if (TREE_CODE (type) == ARRAY_TYPE
&& TYPE_DOMAIN (type) == NULL_TREE)
{
+2019-02-13 Marek Polacek <polacek@redhat.com>
+
+ PR c++/89297 - ICE with OVERLOAD in template.
+ * g++.dg/cpp0x/initlist113.C: New test.
+
2019-02-13 Alexandre Oliva <aoliva@redhat.com>
PR c++/86379
--- /dev/null
+// PR c++/89297
+// { dg-do compile { target c++11 } }
+
+int id(int v) { return v; }
+float id(float v) { return v; }
+
+template <typename>
+int foo(int v)
+{
+ return int{id(v)};
+}