diff options
author | Martin Uecker <uecker@tugraz.at> | 2022-12-17 15:34:30 +0100 |
---|---|---|
committer | Martin Uecker <uecker@gcc.gnu.org> | 2025-08-06 18:02:35 +0200 |
commit | d4ad08583965a4cc70c1aef658f63f335caf4880 (patch) | |
tree | 4f81d09f0db0ba5bd45141f41a07a249c3557408 /libjava | |
parent | 0d0837df6973e00c143a04fe652d74e4df856a2e (diff) | |
download | gcc-d4ad08583965a4cc70c1aef658f63f335caf4880.zip gcc-d4ad08583965a4cc70c1aef658f63f335caf4880.tar.gz gcc-d4ad08583965a4cc70c1aef658f63f335caf4880.tar.bz2 |
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.
Diffstat (limited to 'libjava')
0 files changed, 0 insertions, 0 deletions