https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113979

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Eric Botcazou
<ebotca...@gcc.gnu.org>:

https://gcc.gnu.org/g:f9e1d7aa8b4f0b8afff1de59fcadf1db0244b4e1

commit r12-10197-gf9e1d7aa8b4f0b8afff1de59fcadf1db0244b4e1
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,
            remove call to Apply_Predicate_Check.

    gcc/testsuite/
            * gnat.dg/predicate15.adb: New test.

Reply via email to