diff options
author | Steve Baird <baird@adacore.com> | 2022-07-29 15:54:19 -0700 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-09-06 09:14:20 +0200 |
commit | 152f968e86d14bbebe3e69286dd7a9257e3ca174 (patch) | |
tree | 2a71f82cd9e396d197c925a3e6a10ce38bd20da1 /gcc/cppdefault.cc | |
parent | ec95a21b5246af342fd91c9fe99022c1f2e9d7bf (diff) | |
download | gcc-152f968e86d14bbebe3e69286dd7a9257e3ca174.zip gcc-152f968e86d14bbebe3e69286dd7a9257e3ca174.tar.gz gcc-152f968e86d14bbebe3e69286dd7a9257e3ca174.tar.bz2 |
[Ada] ICE handling discriminant-dependent index constraint for access component
The compiler would fail with an internal error in some cases involving
a discriminated record type that provides a discriminant-dependent index
constraint for the subtype of a component of an access-to-array type when a
dereference of that component of some object is mentioned in a pre- or
postcondition expression.
gcc/ada/
* sem_ch4.adb
(Analyze_Selected_Component): Define new Boolean-valued function,
Constraint_Has_Unprefixed_Discriminant_Reference, which takes a
subtype that is subject to a discriminant-dependent constraint and
returns True if any of the constraint values are unprefixed
discriminant names. Usually, the Etype of a selected component
node is set to Etype of the component. However, in the case of an
access-to-array component for which this predicate returns True,
we instead use the base type of the Etype of the component.
Normally such problematic discriminant references are addressed by
calling Build_Actual_Subtype_Of_Component, but that doesn't work
if Full_Analyze is False.
Diffstat (limited to 'gcc/cppdefault.cc')
0 files changed, 0 insertions, 0 deletions