https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53548
--- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Qing Zhao <qinz...@gcc.gnu.org>: https://gcc.gnu.org/g:6634a409124a884ff66b3756568a7daae7d3c295 commit r15-211-g6634a409124a884ff66b3756568a7daae7d3c295 Author: Qing Zhao <qing.z...@oracle.com> Date: Mon May 6 16:28:01 2024 +0000 Update the C FE routine "add_flexible_array_elts_to_size" C++ FE routine "layout_var_decl" to handle the cases when the DECL is union. PR c/53548 Add testing cases to test the _bos for flexible array members in unions or alone in structures. gcc/c/ChangeLog: PR c/53548 * c-decl.cc (add_flexible_array_elts_to_size): Handle the cases when the DECL is union. gcc/cp/ChangeLog: PR c/53548 * decl.cc (layout_var_decl): Handle the cases when the DECL is union with a flexible array member initializer. gcc/testsuite/ChangeLog: PR c/53548 * c-c++-common/fam-in-union-alone-in-struct-bos-1.c: New test. * c-c++-common/fam-in-union-alone-in-struct-bos.c: New test.