https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108931
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Uecker <uec...@gcc.gnu.org>: https://gcc.gnu.org/g:d4ad08583965a4cc70c1aef658f63f335caf4880 commit r16-3049-gd4ad08583965a4cc70c1aef658f63f335caf4880 Author: Martin Uecker <uec...@tugraz.at> Date: Sat Dec 17 15:34:30 2022 +0100 c2y: Evaluate size expression only in the active branch of conditional operator [PR108931] For size expressions in the branches of the conditional operator should be evaluated only for the active branch. To achieve this, construct also the size expressions for the composite type as conditional expressions depending on the condition of the conditional operator. The change avoids some undefined behavior removed by N3652, but the new constraints for C2Y are not yet implemented. PR c/108931 gcc/c/ChangeLog: * c-typeck.cc (composite_type_cond): Renamed from composite_type with argument for condition (composite_type): New function. (composite_type_internal): Implement new logic. (build_conditional_expr): Pass condition. (common_pointer_type): Adapt. (pointer_diff): Adapt. (build_binary_op): Adapt. gcc/testsuite/ChangeLog: * gcc.dg/vla-tert-1.c: New test.