diff options
Diffstat (limited to 'gcc/ada/par-ch10.adb')
-rw-r--r-- | gcc/ada/par-ch10.adb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb index 00cbd9b1569..86d47b3c2c3 100644 --- a/gcc/ada/par-ch10.adb +++ b/gcc/ada/par-ch10.adb @@ -300,9 +300,14 @@ package body Ch10 is Append_List (P_Context_Clause, Context_Items (Comp_Unit_Node)); else - Error_Msg_SC ("compilation unit expected"); - Cunit_Error_Flag := True; - Resync_Cunit; + if Operating_Mode = Check_Syntax and then Token = Tok_EOF then + Error_Msg_SC ("?file contains no compilation units"); + + else + Error_Msg_SC ("compilation unit expected"); + Cunit_Error_Flag := True; + Resync_Cunit; + end if; -- If we are at an end of file, then just quit, the above error -- message was complaint enough. |