]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Enforce deferred constant completion rules
authorSteve Baird <baird@adacore.com>
Thu, 26 May 2022 00:21:39 +0000 (17:21 -0700)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 4 Jul 2022 07:45:57 +0000 (07:45 +0000)
commitf3451ba8aa3a54c6f09ee049a1a406603ed2ec30
treef8dfcb2de113874f7af781e0e8055719da89fcaf
parent4b766285b089ba1bce91a7644b9d97836e80cda3
[Ada] Enforce deferred constant completion rules

If a constrained subtype is given when a deferred constant is declared,
then the subtype given in the completion is required (at compile time)
to be subject to a statically matching constraint. This rule was not
properly enforced in some cases and constructs that should have been
rejected were incorrectly accepted.

gcc/ada/

* sem_ch3.adb (Check_Possible_Deferred_Completion): Delete
Prev_Obj_Def formal parameter.  Reorganize code so that
statically matching check is also performed in the case where
the subtype given in the initial declaration is constrained and
the subtype given in the completion is not.
gcc/ada/sem_ch3.adb