From: charlet Date: Wed, 27 Oct 2004 13:40:29 +0000 (+0000) Subject: 2004-10-26 Ed Schonberg X-Git-Tag: upstream/4.9.2~66587 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4cd01667e2fcbefea2197778e01054dc69d1cbc;p=platform%2Fupstream%2Flinaro-gcc.git 2004-10-26 Ed Schonberg * sem_ch10.adb (Optional_Subunit): If file of expected subunit is empty, post message on stub. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89666 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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));