[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 30 Aug 2011 13:57:09 +0000 (15:57 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 30 Aug 2011 13:57:09 +0000 (15:57 +0200)
2011-08-30  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch12.adb (Check_Private_View): Exchange the private and full view
of a designated type when the related access type is an actual in an
instance. This ensures that the full view of designated type is
available when inside the body of the instance.

2011-08-30  Ed Schonberg  <schonberg@adacore.com>

* sem_util.adb (May_Be_Lvalue): To determine whether a reference may be
in a position to be modified, a slice is treated like an indexed
component.

From-SVN: r178308

gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb
gcc/ada/sem_util.adb

index 0ef75da9cae6141eac4309a6785085d9fecbe18a..fcb90dd9c3c6fc7f6d4d0d82e6daf661545f47a2 100644 (file)
@@ -1,3 +1,16 @@
+2011-08-30  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_ch12.adb (Check_Private_View): Exchange the private and full view
+       of a designated type when the related access type is an actual in an
+       instance. This ensures that the full view of designated type is
+       available when inside the body of the instance.
+
+2011-08-30  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_util.adb (May_Be_Lvalue): To determine whether a reference may be
+       in a position to be modified, a slice is treated like an indexed
+       component.
+
 2011-08-30  Thomas Quinot  <quinot@adacore.com>
 
        * s-oscons-tmplt.c, g-socket.ads: Adjust maximum allowed value for
index 39ba9b95c110daae85b26b8d066f4a16889dec33..b9c8ab1598135b85b8677e4c09c8dd56f253442f 100644 (file)
@@ -5749,12 +5749,17 @@ package body Sem_Ch12 is
             end if;
 
          --  For composite types with inconsistent representation exchange
-         --  component types accordingly.
+         --  component types accordingly. We exchange the private and full view
+         --  of a designated type when the related access type is an actual in
+         --  an instance. This ensures that the full view of designated type is
+         --  available when inside the body of the instance.
+         --  Is this right ???
 
          elsif Is_Access_Type (T)
            and then Is_Private_Type (Designated_Type (T))
            and then not Has_Private_View (N)
            and then Present (Full_View (Designated_Type (T)))
+           and then Used_As_Generic_Actual (T)
          then
             Switch_View (Designated_Type (T));
 
index 5306ec6bbd27d40adff9d08ca15eed6fbffa0cc0..4b48a5ab505b492bed5bfac77c767b1c01d3fc3a 100644 (file)
@@ -9044,7 +9044,7 @@ package body Sem_Util is
          --  or slice is an lvalue, except if it is an access type, where we
          --  have an implicit dereference.
 
-         when N_Indexed_Component    =>
+         when N_Indexed_Component | N_Slice    =>
             if N /= Prefix (P)
               or else (Present (Etype (N)) and then Is_Access_Type (Etype (N)))
             then