-- not get reset by any Error_Msg call, so the caller is responsible
-- for resetting it.
+ Error_Msg_Qual_For_Standard : Boolean := False;
+ -- Typically we do not want to specify the Standard package when presenting
+ -- entity names even when Error_Msg_Qual_Level is not zero. However
+ -- sometimes we want to emphasize the fact that it is the entity from
+ -- standard. Note that this value does not get reset by any Error_Msg call,
+ -- so the caller is responsible for resetting it.
+
Current_Error_Source_File : Source_File_Index := No_Source_File;
-- Id of current messages. Used to post file name when unit changes. This
-- is initialized to Main_Source_File at the start of a compilation, which
procedure Set_Qualification (N : Nat; E : Entity_Id) is
begin
- if N /= 0 and then Scope (E) /= Standard_Standard then
+ if N /= 0
+ and then
+ (Scope (E) /= Standard_Standard or else Error_Msg_Qual_For_Standard)
+ then
Set_Qualification (N - 1, Scope (E));
Set_Msg_Node (Scope (E));
Set_Msg_Char ('.');
-- not get reset by any Error_Msg call, so the caller is responsible
-- for resetting it.
+ Error_Msg_Qual_For_Standard : Boolean renames
+ Err_Vars.Error_Msg_Qual_For_Standard;
+
Error_Msg_Warn : Boolean renames Err_Vars.Error_Msg_Warn;
-- Used if current message contains a < insertion character to indicate
-- if the current message is a warning message. Must be set appropriately
if Present (Homonym (S))
and then Sloc (Homonym (S)) = Standard_Location
then
+ Error_Msg_Qual_For_Standard := True;
+ Error_Msg_Qual_Level := 1;
Error_Msg_NE
- ("\\did you mean & in Standard'?",
- Name (N),
- Homonym (S));
+ ("\\did you mean &'?", Name (N), Homonym (S));
+ Error_Msg_Qual_For_Standard := False;
+ Error_Msg_Qual_Level := 0;
end if;
else
Error_Msg_N ("too many arguments in call to&", Name (N));