[Bug ada/113979] [11/12/13/14 regression] bogus error on allocator for array type with Dynamic_Predicate
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 7 14:18:47 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113979
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Eric Botcazou
<ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:0e591e6f27a20c26672ea8c0550a6ef673c1fccf
commit r13-8409-g0e591e6f27a20c26672ea8c0550a6ef673c1fccf
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Thu Mar 7 15:05:54 2024 +0100
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,
remove call to Apply_Predicate_Check.
gcc/testsuite/
* gnat.dg/predicate15.adb: New test.
More information about the Gcc-bugs
mailing list