aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-05-29 12:02:28 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-06-20 09:30:49 +0200
commitccacd752a4a58f34b768122a1e463e8ca5f2728e (patch)
treed56e64a53b64f891df2ee9843b182b7746164120 /gcc/ada/sem_res.adb
parentd22792bc24fa1df6d23ace67ca127fdcde979031 (diff)
downloadgcc-ccacd752a4a58f34b768122a1e463e8ca5f2728e.zip
gcc-ccacd752a4a58f34b768122a1e463e8ca5f2728e.tar.gz
gcc-ccacd752a4a58f34b768122a1e463e8ca5f2728e.tar.bz2
ada: Small fixes to handling of private views in instances
The main change is the removal of the special bypass for private views in Resolve_Implicit_Dereference, which in exchange requires additional work in Check_Generic_Actuals and a couple more calls to Set_Global_Type in Save_References_In_Identifier. This also removes an unused parameter in Convert_View and adds a missing comment in Build_Derived_Record_Type. gcc/ada/ * exp_ch7.adb (Convert_View): Remove Ind parameter and adjust. * sem_ch12.adb (Check_Generic_Actuals): Check the type of both in and in out actual objects, as well as the type of formal parameters of actual subprograms. Extend the condition under which the views are swapped to nested generic constructs. (Save_References_In_Identifier): Call Set_Global_Type on a global identifier rewritten as an explicit dereference, either directly or after having first been rewritten as a function call. (Save_References_In_Operator): Set N2 unconditionally and reuse it. * sem_ch3.adb (Build_Derived_Record_Type): Add missing comment. * sem_res.adb (Resolve_Implicit_Dereference): Remove special bypass for private views in instances.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb11
1 files changed, 0 insertions, 11 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 41787f3..266cf8e 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -9601,17 +9601,6 @@ package body Sem_Res is
Desig_Typ : Entity_Id;
begin
- -- In an instance the proper view may not always be correct for
- -- private types, see e.g. Sem_Type.Covers for similar handling.
-
- if Is_Private_Type (Etype (P))
- and then Present (Full_View (Etype (P)))
- and then Is_Access_Type (Full_View (Etype (P)))
- and then In_Instance
- then
- Set_Etype (P, Full_View (Etype (P)));
- end if;
-
if Is_Access_Type (Etype (P)) then
Desig_Typ := Implicitly_Designated_Type (Etype (P));
Insert_Explicit_Dereference (P);