aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_cat.adb
diff options
context:
space:
mode:
authorThomas Quinot <quinot@adacore.com>2005-03-29 18:19:33 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2005-03-29 18:19:33 +0200
commit6332d8420e1069330ec15e58d97702c20fe856d6 (patch)
tree6e697df86b5a439af1b9009cca5a2ae1fd79e0f8 /gcc/ada/sem_cat.adb
parent73e69194b512e909a964bd389904b520658490cc (diff)
downloadgcc-6332d8420e1069330ec15e58d97702c20fe856d6.zip
gcc-6332d8420e1069330ec15e58d97702c20fe856d6.tar.gz
gcc-6332d8420e1069330ec15e58d97702c20fe856d6.tar.bz2
sem_cat.adb (Validate_Remote_Types_Type_Conversion): Perform check to forbid conversion of a local access-to-subprogram type to a...
2005-03-29 Thomas Quinot <quinot@adacore.com> * sem_cat.adb (Validate_Remote_Types_Type_Conversion): Perform check to forbid conversion of a local access-to-subprogram type to a remote one. * sem_util.adb (Wrong_Type): For a record type that is the expanded equivalent type for a remote access-to-subprogram type, go back to the original RAS entity when displaying an error message, so the casing is the original source casing. From-SVN: r97182
Diffstat (limited to 'gcc/ada/sem_cat.adb')
-rw-r--r--gcc/ada/sem_cat.adb15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb
index 44d5f59..a17521c 100644
--- a/gcc/ada/sem_cat.adb
+++ b/gcc/ada/sem_cat.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1529,13 +1529,22 @@ package body Sem_Cat is
if Is_Remote_Access_To_Subprogram_Type (E)
and then not Is_Remote_Access_To_Subprogram_Type (S)
then
- Error_Msg_N ("incorrect conversion of remote operand", N);
+ Error_Msg_N
+ ("incorrect conversion of remote operand to local type", N);
+ return;
+
+ elsif not Is_Remote_Access_To_Subprogram_Type (E)
+ and then Is_Remote_Access_To_Subprogram_Type (S)
+ then
+ Error_Msg_N
+ ("incorrect conversion of local operand to remote type", N);
return;
elsif Is_Remote_Access_To_Class_Wide_Type (E)
and then not Is_Remote_Access_To_Class_Wide_Type (S)
then
- Error_Msg_N ("incorrect conversion of remote operand", N);
+ Error_Msg_N
+ ("incorrect conversion of remote operand to local type", N);
return;
end if;