]> git.ipfire.org Git - thirdparty/gcc.git/commit
Update the C FE routine "add_flexible_array_elts_to_size" C++ FE routine "layout_var_...
authorQing Zhao <qing.zhao@oracle.com>
Mon, 6 May 2024 16:28:01 +0000 (16:28 +0000)
committerQing Zhao <qing.zhao@oracle.com>
Mon, 6 May 2024 18:35:09 +0000 (18:35 +0000)
commit6634a409124a884ff66b3756568a7daae7d3c295
treeee2176800591f6bd6078c3754f2fe8486ee5f2e6
parent93f6a47583f3fa8a1b66856ecb19ec28f26b2ba4
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.
gcc/c/c-decl.cc
gcc/cp/decl.cc
gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-bos-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-bos.c [new file with mode: 0644]