aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-30 15:57:09 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-30 15:57:09 +0200
commitdff99e1a52a750cb5c1be4e5f0ccb1567e0ca015 (patch)
tree7cb1ff0e6c6dc2fb39501b599bcc0e9943641376 /gcc
parent63be2a5ab4f84b257cb17d3a8f16bc56ff8927bc (diff)
downloadgcc-dff99e1a52a750cb5c1be4e5f0ccb1567e0ca015.zip
gcc-dff99e1a52a750cb5c1be4e5f0ccb1567e0ca015.tar.gz
gcc-dff99e1a52a750cb5c1be4e5f0ccb1567e0ca015.tar.bz2
[multiple changes]
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog13
-rw-r--r--gcc/ada/sem_ch12.adb7
-rw-r--r--gcc/ada/sem_util.adb2
3 files changed, 20 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0ef75da..fcb90dd 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 39ba9b9..b9c8ab1 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -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));
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 5306ec6..4b48a5a 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -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