* 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
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));