freeze.adb (Check_Component_Storage_Order): Get full view of component type.
authorThomas Quinot <quinot@adacore.com>
Mon, 2 May 2016 09:29:09 +0000 (09:29 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 2 May 2016 09:29:09 +0000 (11:29 +0200)
2016-05-02  Thomas Quinot  <quinot@adacore.com>

* freeze.adb (Check_Component_Storage_Order): Get full view of
component type.

From-SVN: r235716

gcc/ada/ChangeLog
gcc/ada/freeze.adb

index f867b8271cb103d003354f13ad279b4a8daf994b..c4fa0ae19af307c187131ee7526ffd3a1ae83ff5 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-02  Thomas Quinot  <quinot@adacore.com>
+
+       * freeze.adb (Check_Component_Storage_Order): Get full view of
+       component type.
+
 2016-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * checks.adb, freeze.adb, sem_res.adb, s-stposu.adb, repinfo.adb:
index bbb07af9d349dadba14f51b24fcf33348a70ad64..1fce94778185b24d35fc1f79cae6c68836fd6270 100644 (file)
@@ -1242,6 +1242,13 @@ package body Freeze is
       --  the attribute definition clause is attached to the first subtype.
 
       Comp_Type := Base_Type (Comp_Type);
+
+      --  If the base type is incomplete or private, go to full view if known
+
+      if Present (Underlying_Type (Comp_Type)) then
+         Comp_Type := Underlying_Type (Comp_Type);
+      end if;
+
       Comp_ADC := Get_Attribute_Definition_Clause
                     (First_Subtype (Comp_Type),
                      Attribute_Scalar_Storage_Order);