aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2014-05-21 12:54:18 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-05-21 14:54:18 +0200
commita8a89b743d7f22120969402642b2375537c67243 (patch)
treef93d17de84149a9537b9bf0cfa91199fff07ad7f
parent95bc61b2e3158874bbf8c026961e031fbcdb3520 (diff)
downloadgcc-a8a89b743d7f22120969402642b2375537c67243.zip
gcc-a8a89b743d7f22120969402642b2375537c67243.tar.gz
gcc-a8a89b743d7f22120969402642b2375537c67243.tar.bz2
sem_ch3.adb (Build_Derived_Record_Type): Initialize Parent_Base to the full view of the parent type when...
2014-05-21 Javier Miranda <miranda@adacore.com> * sem_ch3.adb (Build_Derived_Record_Type): Initialize Parent_Base to the full view of the parent type when processing a derived type which is the full view of a private type not defined in a generic unit which is derived from a private type with discriminants whose full view is a non-tagged record type. From-SVN: r210699
-rw-r--r--gcc/ada/ChangeLog8
-rw-r--r--gcc/ada/sem_ch3.adb14
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3bd0c7e..9c47f98 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,13 @@
2014-05-21 Javier Miranda <miranda@adacore.com>
+ * sem_ch3.adb (Build_Derived_Record_Type): Initialize Parent_Base
+ to the full view of the parent type when processing a derived type
+ which is the full view of a private type not defined in a generic
+ unit which is derived from a private type with discriminants
+ whose full view is a non-tagged record type.
+
+2014-05-21 Javier Miranda <miranda@adacore.com>
+
* exp_ch4.adb (Expand_Allocator_Expression.Apply_Accessibility_Check):
Complete previous patch.
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 06f314a..969674a 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -7453,6 +7453,20 @@ package body Sem_Ch3 is
and then Has_Discriminants (Parent_Type)
then
Parent_Base := Base_Type (Full_View (Parent_Type));
+
+ -- Handle a derived type which is the full view of a private type not
+ -- defined in a generic unit which is derived from a private type with
+ -- discriminants whose full view is a non-tagged record type.
+
+ elsif not Inside_A_Generic
+ and then Ekind (Parent_Type) = E_Private_Type
+ and then Has_Discriminants (Parent_Type)
+ and then Present (Full_View (Parent_Type))
+ and then Is_Record_Type (Full_View (Parent_Type))
+ and then not Is_Tagged_Type (Full_View (Parent_Type))
+ and then Has_Private_Declaration (Derived_Type)
+ then
+ Parent_Base := Base_Type (Full_View (Parent_Type));
else
Parent_Base := Base_Type (Parent_Type);
end if;