PR c++/71912 - [6/7 regression] flexible array in struct in union rejected
authorMartin Sebor <msebor@gcc.gnu.org>
Thu, 13 Oct 2016 22:26:36 +0000 (16:26 -0600)
committerMartin Sebor <msebor@gcc.gnu.org>
Thu, 13 Oct 2016 22:26:36 +0000 (16:26 -0600)
commit960320472221464b48db6c2a1523b5f74b74d016
tree3a71752f8a6dd2bdac0321e7226ba6861d5ea8cc
parent253abb2a156c6ea7d1631bbe9da32070fdfe901b
PR c++/71912 - [6/7 regression] flexible array in struct in union rejected

gcc/cp/ChangeLog:

PR c++/71912
* class.c (struct flexmems_t):  Add members.
(find_flexarrays): Add arguments.  Correct handling of anonymous
structs.
(diagnose_flexarrays): Adjust to issue warnings in addition to errors.
(check_flexarrays): Add argument.
(diagnose_invalid_flexarray): New functions.

gcc/testsuite/ChangeLog:

PR c++/71912
* g++.dg/ext/flexary4.C: Adjust.
* g++.dg/ext/flexary5.C: Same.
* g++.dg/ext/flexary9.C: Same.
* g++.dg/ext/flexary19.C: New test.
* g++.dg/ext/flexary18.C: New test.
* g++.dg/torture/pr64312.C: Add a dg-error directive to an ill-formed
regression test.
        * g++.dg/compat/struct-layout-1_generate.c (subfield): Add argument.
        Avoid generating a flexible array member in an array.

From-SVN: r241143
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
gcc/testsuite/g++.dg/ext/flexary18.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/flexary19.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/flexary4.C
gcc/testsuite/g++.dg/ext/flexary5.C
gcc/testsuite/g++.dg/ext/flexary9.C
gcc/testsuite/g++.dg/torture/pr64312.C