]> gcc.gnu.org Git - gcc.git/commit
Evaluate arguments of sizeof that are structs of variable size.
authorMartin Uecker <muecker@gwdg.de>
Tue, 10 Aug 2021 05:42:51 +0000 (07:42 +0200)
committerMartin Uecker <muecker@gwdg.de>
Tue, 10 Aug 2021 05:49:57 +0000 (07:49 +0200)
commit0631faf87a197145acd833249bf8f20a1c4aaabf
tree0ec94e5d7ad338e9051b5b6560b5521597d01687
parent3d7ccbc1efbd475031a9a4a6110c531f71fbf631
Evaluate arguments of sizeof that are structs of variable size.

Evaluate arguments of sizeof for all types of variable size
and not just for VLAs. This fixes some issues related to
[PR29970] where statement expressions need to be evaluated
so that the size is well defined.

2021-08-10  Martin Uecker  <muecker@gwdg.de>

gcc/c/
PR c/29970
* c-typeck.c (c_expr_sizeof_expr): Evaluate
size expressions for structs of variable size.

gcc/testsuite/
PR c/29970
* gcc.dg/vla-stexp-1.c: New test.
gcc/c/c-typeck.c
gcc/testsuite/gcc.dg/vla-stexp-1.c [new file with mode: 0644]
This page took 0.062222 seconds and 5 git commands to generate.