[Bug c++/71912] [6 regression] flexible array in struct in union rejected

2016-10-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71912

Martin Sebor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Martin Sebor  ---
Backported to 6-branch in r241168.

[Bug c++/71912] [6 regression] flexible array in struct in union rejected

2016-10-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71912

--- Comment #9 from Martin Sebor  ---
Author: msebor
Date: Fri Oct 14 15:37:54 2016
New Revision: 241168

URL: https://gcc.gnu.org/viewcvs?rev=241168=gcc=rev
Log:
PR c++/71912 - [6/7 regression] flexible array in struct in union rejected

gcc/cp/ChangeLog:
* 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:
* 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.


Modified:
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/cp/class.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog
   
branches/gcc-6-branch/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
branches/gcc-6-branch/gcc/testsuite/g++.dg/ext/flexary4.C
branches/gcc-6-branch/gcc/testsuite/g++.dg/ext/flexary5.C
branches/gcc-6-branch/gcc/testsuite/g++.dg/ext/flexary9.C
branches/gcc-6-branch/gcc/testsuite/g++.dg/torture/pr64312.C

[Bug c++/71912] [6 regression] flexible array in struct in union rejected

2016-10-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71912

Martin Sebor  changed:

   What|Removed |Added

Summary|[6/7 regression] flexible   |[6 regression] flexible
   |array in struct in union|array in struct in union
   |rejected|rejected
  Known to fail|7.0 |

--- Comment #8 from Martin Sebor  ---
Fixed on trunk in r241143.