diff options
author | Arnaud Charlet <charlet@adacore.com> | 2020-07-23 09:11:56 -0400 |
---|---|---|
committer | Arnaud Charlet <charlet@adacore.com> | 2020-07-23 09:42:06 -0400 |
commit | 3968b02a4b1dd783b6a8376175061adc195110f4 (patch) | |
tree | 679a428cd1c49fe08ea074ceebbaaa73f4961751 /gcc/ada/sem_ch13.ads | |
parent | de8bfcc8e45d9c77c48c9f071836698aa6db5ff3 (diff) | |
download | gcc-3968b02a4b1dd783b6a8376175061adc195110f4.zip gcc-3968b02a4b1dd783b6a8376175061adc195110f4.tar.gz gcc-3968b02a4b1dd783b6a8376175061adc195110f4.tar.bz2 |
[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.
Diffstat (limited to 'gcc/ada/sem_ch13.ads')
-rw-r--r-- | gcc/ada/sem_ch13.ads | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/ada/sem_ch13.ads b/gcc/ada/sem_ch13.ads index 43aea2a..3d24c04 100644 --- a/gcc/ada/sem_ch13.ads +++ b/gcc/ada/sem_ch13.ads @@ -128,6 +128,14 @@ package Sem_Ch13 is -- If the size is too small, and an error message is given, then both -- Esize and RM_Size are reset to the allowed minimum value in T. + function Has_Compatible_Representation + (Target_Type, Operand_Type : Entity_Id) return Boolean; + -- Given two types, where the two types are related by possible derivation, + -- determines if the two types have compatible representation, or different + -- representations, requiring the special processing for representation + -- change. A False result is possible only for array, enumeration or + -- record types. + procedure Parse_Aspect_Aggregate (N : Node_Id; Empty_Subp : in out Node_Id; @@ -196,13 +204,6 @@ package Sem_Ch13 is -- because such clauses are linked on to the Rep_Item chain in procedure -- Sem_Ch13.Analyze_Aspect_Specifications. See that procedure for details. - function Same_Representation (Typ1, Typ2 : Entity_Id) return Boolean; - -- Given two types, where the two types are related by possible derivation, - -- determines if the two types have the same representation, or different - -- representations, requiring the special processing for representation - -- change. A False result is possible only for array, enumeration or - -- record types. - procedure Validate_Unchecked_Conversion (N : Node_Id; Act_Unit : Entity_Id); |