summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-06 10:03:21 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-06 10:03:21 +0000
commit23459b95cbc0efc2c4f71d1775c8da56429ffd25 (patch)
tree96c5fcb8e6db82bb4d5426f17a684a057387a004 /gcc
parent9afa58a5b90c96bce0e094a6377350e9765504fd (diff)
downloadppe42-gcc-23459b95cbc0efc2c4f71d1775c8da56429ffd25.tar.gz
ppe42-gcc-23459b95cbc0efc2c4f71d1775c8da56429ffd25.zip
2008-08-06 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Analyze_Component_Declaration): Protect against misuse of incomplete type. * sem_ch8.adb (Analyze_Object_Renaming): Diagnose properly a renaming of a formal parameter of an incomplete type. Improve error message for other improper uses of incomplete types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138790 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch3.adb1
-rw-r--r--gcc/ada/sem_ch8.adb5
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index bc16c08cb27..18538c878be 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -1667,6 +1667,7 @@ package body Sem_Ch3 is
if Ada_Version >= Ada_05
and then Ekind (T) = E_Anonymous_Access_Type
+ and then Etype (E) /= Any_Type
then
-- Check RM 3.9.2(9): "if the expected type for an expression is
-- an anonymous access-to-specific tagged type, then the object
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index f6acc6c6ca1..c52f5ad7dcb 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -832,7 +832,10 @@ package body Sem_Ch8 is
if Nkind (Nam) = N_Explicit_Dereference
and then Ekind (Etype (T2)) = E_Incomplete_Type
then
- Error_Msg_N ("invalid use of incomplete type", Id);
+ Error_Msg_NE ("invalid use of incomplete type&", Id, T2);
+ return;
+ elsif Ekind (Etype (T)) = E_Incomplete_Type then
+ Error_Msg_NE ("invalid use of incomplete type&", Id, T);
return;
end if;
OpenPOWER on IntegriCloud