https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113979
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eric Botcazou <ebotca...@gcc.gnu.org>: https://gcc.gnu.org/g:e71a4e81729516eed8782a255ff37617e6fd4b69 commit r14-9361-ge71a4e81729516eed8782a255ff37617e6fd4b69 Author: Eric Botcazou <ebotca...@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, call Apply_Predicate_Check on the resulting access value if needed. gcc/testsuite/ * gnat.dg/predicate15.adb: New test.