aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-06-13 12:03:43 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-06-13 12:03:43 +0200
commit446ebdbbd062cec9a8db76dcd5882683268d00a8 (patch)
tree78623ddf8772ac78c5814c15f74fe937c361bd95 /gcc/ada/sem_ch3.adb
parentc86cf71483eb73bf8d637e4c9d6caef3b67b09a2 (diff)
downloadgcc-446ebdbbd062cec9a8db76dcd5882683268d00a8.zip
gcc-446ebdbbd062cec9a8db76dcd5882683268d00a8.tar.gz
gcc-446ebdbbd062cec9a8db76dcd5882683268d00a8.tar.bz2
[multiple changes]
2014-06-13 Robert Dewar <dewar@adacore.com> * layout.adb (Layout_Type): Anonymous access types designating unconstrained arrays are always thin pointers. * sem_ch3.adb (Replace_Type): Anonymous access types designating unconstrained arrays are always thin pointers. 2014-06-13 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute): Use Check_Parameterless_Call to resolve the prefix of an attribute that is an entity name and may be a parameterless call. Minor code reorganization. From-SVN: r211618
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb21
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 2748a83..938c28e 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -13562,21 +13562,23 @@ package body Sem_Ch3 is
-- interface primitives.
or else (Is_Interface (Desig_Typ)
- and then not Is_Class_Wide_Type (Desig_Typ))
+ and then not Is_Class_Wide_Type (Desig_Typ))
then
Acc_Type := New_Copy (Etype (Id));
Set_Etype (Acc_Type, Acc_Type);
Set_Scope (Acc_Type, New_Subp);
- -- Compute size of anonymous access type
+ -- Set size of anonymous access type. Note that anonymous
+ -- access to Unconstrained always uses thin pointers. This
+ -- avoids confusion for the case where two types that should
+ -- conform but end up differning, because in one case we can
+ -- see the unconstrained designated type, and in the other
+ -- case we can't see it yet (full type declaration not seen
+ -- yet), so we default to thin in that case anyway.
- if Is_Array_Type (Desig_Typ)
- and then not Is_Constrained (Desig_Typ)
- then
- Init_Size (Acc_Type, 2 * System_Address_Size);
- else
- Init_Size (Acc_Type, System_Address_Size);
- end if;
+ Init_Size (Acc_Type, System_Address_Size);
+
+ -- Set remaining characterstics of anonymous access type
Init_Alignment (Acc_Type);
Set_Directly_Designated_Type (Acc_Type, Derived_Type);
@@ -13585,6 +13587,7 @@ package body Sem_Ch3 is
Set_Scope (New_Id, New_Subp);
-- Create a reference to it
+
Build_Itype_Reference (Acc_Type, Parent (Derived_Type));
else