aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2008-08-05 16:37:44 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-05 16:37:44 +0200
commit434d3cf1fd098c0f3ab5b8f14bf512e0c077cda6 (patch)
treecb34d71cbbef2e4cf35e0cc52a8b05226422b472 /gcc
parent8d9509fd725209f785a5ded6152ff9aa97058cde (diff)
downloadgcc-434d3cf1fd098c0f3ab5b8f14bf512e0c077cda6.zip
gcc-434d3cf1fd098c0f3ab5b8f14bf512e0c077cda6.tar.gz
gcc-434d3cf1fd098c0f3ab5b8f14bf512e0c077cda6.tar.bz2
sem_ch5.adb (Analyze_Assignment_Statement): Apply conversion to right-hand side when it is an anonymous access_to_subprogram...
2008-08-05 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assignment_Statement): Apply conversion to right-hand side when it is an anonymous access_to_subprogram, to force static accessibility check when needed. From-SVN: r138723
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog22
-rw-r--r--gcc/ada/sem_ch5.adb15
2 files changed, 31 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 38a333a..a0b29ac 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,25 @@
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * gsocket.h: Make this file includable in a Nucleus environment, which
+ does not support sockets.
+
+ * socket.c: Remove Nucleus-specific hack.
+
+2008-08-05 Pascal Obry <obry@adacore.com>
+
+ * adaint.c: Remove support for readable attribute on vxworks and nucleus
+
+2008-08-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_attr.adb:
+ (Analyze_Attribute, case 'Result): handle properly the case where some
+ operand of the expression in a post-condition generates a transient
+ block.
+
+ * sem_ch5.adb (Analyze_Assignment_Statement): Apply conversion to
+ right-hand side when it is an anonymous access_to_subprogram, to force
+ static accessibility check when needed.
+
2008-08-05 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi: Changing the description of the gnatcheck metrics
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 1396759..e5954a9 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -581,16 +581,19 @@ package body Sem_Ch5 is
-- Ada 2005 (AI-385): When the lhs type is an anonymous access type,
-- apply an implicit conversion of the rhs to that type to force
- -- appropriate static and run-time accessibility checks. This
- -- applies as well to anonymous access-to-subprogram types that
- -- are component subtypes.
+ -- appropriate static and run-time accessibility checks. This applies
+ -- as well to anonymous access-to-subprogram types that are component
+ -- subtypes or formal parameters.
if Ada_Version >= Ada_05
and then Is_Access_Type (T1)
- and then Is_Local_Anonymous_Access (T1)
then
- Rewrite (Rhs, Convert_To (T1, Relocate_Node (Rhs)));
- Analyze_And_Resolve (Rhs, T1);
+ if Is_Local_Anonymous_Access (T1)
+ or else Ekind (T2) = E_Anonymous_Access_Subprogram_Type
+ then
+ Rewrite (Rhs, Convert_To (T1, Relocate_Node (Rhs)));
+ Analyze_And_Resolve (Rhs, T1);
+ end if;
end if;
-- Ada 2005 (AI-231): Assignment to not null variable