[Ada] Ada2020: AI12-0027 Access values and unaliased component
authorArnaud Charlet <charlet@adacore.com>
Thu, 23 Jul 2020 13:11:56 +0000 (09:11 -0400)
committerArnaud Charlet <charlet@adacore.com>
Thu, 23 Jul 2020 13:42:06 +0000 (09:42 -0400)
commit3968b02a4b1dd783b6a8376175061adc195110f4
tree679a428cd1c49fe08ea074ceebbaaa73f4961751
parentde8bfcc8e45d9c77c48c9f071836698aa6db5ff3
[Ada] Ada2020: AI12-0027 Access values and unaliased component

Access values should never designate unaliased components.
This new feature is documented in AI12-0027-1.

gcc/ada/

* sem_ch13.ads (Same_Representation): Renamed as
Has_Compatible_Representation because now the order of the arguments
are taken into account; its formals are also renamed as Target_Type
and Operand_Type.
* sem_ch13.adb (Same_Representation): Renamed and moved to place the
routine in alphabetic order.
* sem_attr.adb (Prefix_With_Safe_Accessibility_Level): New subprogram.
(Resolve_Attribute): Check that the prefix of attribute Access
does not have a value conversion of an array type.
* sem_res.adb (Resolve_Actuals): Remove restrictive check on view
conversions which required matching value of Has_Aliased_Components of
formals and actuals.
* exp_ch4.adb (Handle_Changed_Representation): Update call to
Same_Representation.
(Expand_N_Type_Conversion): Update call to Same_Representation.
* exp_ch5.adb (Change_Of_Representation): Update call to
Same_Representation.
* exp_ch6.adb (Add_Call_By_Copy_Code): Update call to
Same_Representation.
(Expand_Actuals): Update call to Same_Representation.
(Expand_Call_Helper): Update call to Same_Representation.
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch5.adb
gcc/ada/exp_ch6.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch13.ads
gcc/ada/sem_res.adb