+2019-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/87148
+ * init.c (build_value_init_noctor): Ignore flexible array members.
+
2019-03-06 Jason Merrill <jason@redhat.com>
PR c++/89576 - if constexpr of lambda capture.
if (ftype == error_mark_node)
continue;
+ /* Ignore flexible array members for value initialization. */
+ if (TREE_CODE (ftype) == ARRAY_TYPE
+ && !COMPLETE_TYPE_P (ftype)
+ && !TYPE_DOMAIN (ftype)
+ && COMPLETE_TYPE_P (TREE_TYPE (ftype))
+ && (next_initializable_field (DECL_CHAIN (field))
+ == NULL_TREE))
+ continue;
+
/* We could skip vfields and fields of types with
user-defined constructors, but I think that won't improve
performance at all; it should be simpler in general just
+2019-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/87148
+ * g++.dg/ext/flexary34.C: New test.
+
2019-03-06 Peter Bergner <bergner@linux.ibm.com>
PR rtl-optimization/88845
--- /dev/null
+// PR c++/87148
+// { dg-do compile }
+// { dg-options "-pedantic" }
+
+struct Tst { int i; char t[]; }; // { dg-warning "forbids flexible array member" }
+
+Tst t {}; // { dg-warning "extended initializer lists only available with" "" { target c++98_only } }
+Tst u = Tst();
+void foo () { Tst u = {}; }
+Tst *bar () { return new Tst (); }