diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-03-07 15:05:54 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2024-03-07 15:08:28 +0100 |
commit | e71a4e81729516eed8782a255ff37617e6fd4b69 (patch) | |
tree | a6742d6e025673ab2d40abe584e7b4f788ba516e /gcc/c | |
parent | 9970b576b7e4ae337af1268395ff221348c4b34a (diff) | |
download | gcc-e71a4e81729516eed8782a255ff37617e6fd4b69.zip gcc-e71a4e81729516eed8782a255ff37617e6fd4b69.tar.gz gcc-e71a4e81729516eed8782a255ff37617e6fd4b69.tar.bz2 |
Fix bogus error on allocator for array type with Dynamic_Predicate
This is a regression present on all active branches: the compiler gives
a bogus error on an allocator for an unconstrained array type declared
with a Dynamic_Predicate because Apply_Predicate_Check is invoked directly
on a subtype reference, which it cannot handle.
This moves the check to the resulting access value (after dereference) like
in Expand_Allocator_Expression.
gcc/ada/
PR ada/113979
* exp_ch4.adb (Expand_N_Allocator): In the subtype indication case,
call Apply_Predicate_Check on the resulting access value if needed.
gcc/testsuite/
* gnat.dg/predicate15.adb: New test.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions