summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-29 16:19:33 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-29 16:19:33 +0000
commit78798edd12e86ae09d38054fc6a0ae363f4a7b2e (patch)
tree6e697df86b5a439af1b9009cca5a2ae1fd79e0f8
parenta4d03817bcd1555f4ee1daba0842147ea630b3a6 (diff)
downloadppe42-gcc-78798edd12e86ae09d38054fc6a0ae363f4a7b2e.tar.gz
ppe42-gcc-78798edd12e86ae09d38054fc6a0ae363f4a7b2e.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97182 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/sem_cat.adb15
-rw-r--r--gcc/ada/sem_util.adb18
2 files changed, 23 insertions, 10 deletions
diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb
index 44d5f597467..a17521cad9d 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;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 00fc1a19a59..fe354349b2c 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -6770,16 +6770,20 @@ package body Sem_Util is
Found_Scope := Scope (Found_Scope);
exit when Expec_Scope = Standard_Standard
- or else
- Found_Scope = Standard_Standard
- or else
- not Comes_From_Source (Expec_Scope)
- or else
- not Comes_From_Source (Found_Scope);
+ or else Found_Scope = Standard_Standard
+ or else not Comes_From_Source (Expec_Scope)
+ or else not Comes_From_Source (Found_Scope);
end loop;
end;
- Error_Msg_NE ("expected}!", Expr, Expec_Type);
+ if Is_Record_Type (Expec_Type)
+ and then Present (Corresponding_Remote_Type (Expec_Type))
+ then
+ Error_Msg_NE ("expected}!", Expr,
+ Corresponding_Remote_Type (Expec_Type));
+ else
+ Error_Msg_NE ("expected}!", Expr, Expec_Type);
+ end if;
if Is_Entity_Name (Expr)
and then Is_Package (Entity (Expr))
OpenPOWER on IntegriCloud