Fix PR c++/79360
gcc/cp/ChangeLog:
PR c++/79360
* typeck2.c (process_init_constructor_union): Consider only
FIELD_DECLs when looking for an NSDMI.
gcc/testsuite/ChangeLog:
PR c++/79360
* g++.dg/cpp1y/nsdmi-union2.C: New test.
From-SVN: r245239
+2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/79360
+ * typeck2.c (process_init_constructor_union): Consider only
+ FIELD_DECLs when looking for an NSDMI.
+
2017-02-06 Jason Merrill <jason@redhat.com>
PR c++/71193 - incomplete types in templates
{
for (tree field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
{
- if (DECL_INITIAL (field))
+ if (TREE_CODE (field) == FIELD_DECL
+ && DECL_INITIAL (field) != NULL_TREE)
{
CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (init),
field,
+2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/79360
+ * g++.dg/cpp1y/nsdmi-union2.C: New test.
+
2017-02-06 Kito Cheng <kito.cheng@gmail.com>
* lib/target-supports.exp: Define the RISC-V target.
--- /dev/null
+// PR c++/79360
+// { dg-do compile { target c++14 } }
+
+union U
+{
+ enum E { e };
+};
+
+struct A
+{
+ U u{};
+};