[Ada] Legal actual type with inherited discriminants rejected in instantiation
authorGary Dismukes <dismukes@adacore.com>
Tue, 30 Jun 2020 22:58:56 +0000 (18:58 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 16 Oct 2020 07:31:34 +0000 (03:31 -0400)
commitf6fd9533f5067a656a992c4c56861395005e2c36
tree1ac2c684a70733e0c49d3eeefccc56c2d30a65e0
parent7e1ccdbb5141e4dd2d4b0c4fdbba80dd5fa9cae4
[Ada] Legal actual type with inherited discriminants rejected in instantiation

gcc/ada/

* sem_eval.adb (Subtypes_Statically_Match): Retrieve
discriminant constraints from the two types via new function
Original_Discriminant_Constraint rather than
Discriminant_Constraint.
(Original_Discriminant_Constraint): New function to locate the
nearest explicit discriminant constraint associated with a type
that may possibly have inherited a constraint from an ancestor
type.
gcc/ada/sem_eval.adb