[Ada] Implement AI12-0351 Matching for actuals for formal derived types
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 3 Apr 2020 10:37:45 +0000 (12:37 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 16 Jun 2020 13:07:11 +0000 (09:07 -0400)
commit0faf0503312ddf6bfc88cecfa1adcd903b20b97c
treeea26d188301fab5b1063c699e1bd41412acec45a
parent28462a4496152c76babdb09806762880633191f5
[Ada] Implement AI12-0351 Matching for actuals for formal derived types

2020-06-16  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* sem_ch12.adb (Validate_Derived_Type_Instance): Reword error
message for 12.5.1(8) subclause and add secondary message if
the incompatibility comes from the predicates.
* sem_ch3.adb (Check_Constraining_Discriminant): New procedure
to give the error required by the 3.7(15) subclause.  Mention
"statically" in the error message and add secondary message
if the incompatibility comes from the predicates.
(Build_Derived_Concurrent_Type): Call it when a new discriminant
constrains an old one.
(Build_Derived_Record_Type): Likewise.
* sem_eval.ads (Predicates_Compatible): Declare.
* sem_eval.adb (Predicates_Compatible): New function to implement
the compatibility of predicates specified by the 4.9.1 clause.
(Subtypes_Statically_Compatible): Call it.
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_eval.adb
gcc/ada/sem_eval.ads