* decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
From-SVN: r252939
2017-09-18 Jason Merrill <jason@redhat.com>
+ PR c++/79607 - ICE with T{} initializer
+ * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
+
PR c++/72457
* init.c (expand_aggr_init_1): Only handle value-init of bases.
* constexpr.c (build_data_member_initialization): Handle multiple
else if (TREE_CODE (init) == CONSTRUCTOR)
/* A brace-enclosed initializer, e.g.: int i = { 3 }; ? */
{
+ if (dependent_type_p (TREE_TYPE (init)))
+ return true;
+
vec<constructor_elt, va_gc> *elts;
size_t nelts;
size_t i;
--- /dev/null
+// PR c++/79607
+// { dg-do compile { target c++11 } }
+
+template<typename T> struct A
+{
+ static const int i = int{T{}};
+};
+
+A<int> a;