aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonber@gnat.com>2004-10-27 15:40:29 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2004-10-27 15:40:29 +0200
commit10b6063358b80caf65dbab1ac0dd3844a3b9a8ac (patch)
tree06af85cbbbfcc3a377c8cdc65041fa8bcde84047 /gcc
parentf529bac5efe50881b6660d0b1cab46cea63ebe7b (diff)
downloadgcc-10b6063358b80caf65dbab1ac0dd3844a3b9a8ac.zip
gcc-10b6063358b80caf65dbab1ac0dd3844a3b9a8ac.tar.gz
gcc-10b6063358b80caf65dbab1ac0dd3844a3b9a8ac.tar.bz2
sem_ch10.adb (Optional_Subunit): If file of expected subunit is empty, post message on stub.
2004-10-26 Ed Schonberg <schonberg@gnat.com> * sem_ch10.adb (Optional_Subunit): If file of expected subunit is empty, post message on stub. From-SVN: r89666
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch10.adb9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index cbdfbc2..b790a93 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -980,7 +980,14 @@ package body Sem_Ch10 is
then
Comp_Unit := Cunit (Unum);
- if Nkind (Unit (Comp_Unit)) /= N_Subunit then
+ -- If the file was empty or seriously mangled, the unit
+ -- itself may be missing.
+
+ if No (Unit (Comp_Unit)) then
+ Error_Msg_N
+ ("subunit does not contain expected proper body", N);
+
+ elsif Nkind (Unit (Comp_Unit)) /= N_Subunit then
Error_Msg_N
("expected SEPARATE subunit, found child unit",
Cunit_Entity (Unum));