-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
else
Write_Str ("Hash_Table (");
- Write_Int (Int (J));
+ Write_Int (J);
Write_Str (") has ");
declare
end if;
for J in S'Range loop
- S (J) := Fold_Lower (Tname (Integer (J) + 4));
+ S (J) := Fold_Lower (Tname (J + 4));
end loop;
Get_Name_String (Token_Name);
and then not Suppress_Restriction_Message (N)
then
Namet.Unlock;
- Check_Restriction (Restriction_Id'(No_Elaboration_Code), N);
+ Check_Restriction (No_Elaboration_Code, N);
Namet.Lock;
end if;
end Check_Elaboration_Code_Allowed;
procedure Check_No_Implicit_Heap_Alloc (N : Node_Id) is
begin
- Check_Restriction (Restriction_Id'(No_Implicit_Heap_Allocations), N);
+ Check_Restriction (No_Implicit_Heap_Allocations, N);
end Check_No_Implicit_Heap_Alloc;
---------------------------
end if;
if Is_Entity_Name (Orig_N)
- and then Etype (Entity (Orig_N)) = Orig_T
+ and then
+ (Etype (Entity (Orig_N)) = Orig_T
+ or else
+ (Ekind (Entity (Orig_N)) = E_Loop_Parameter
+ and then Covers (Orig_T, Etype (Entity (Orig_N)))))
then
+ Error_Msg_Node_2 := Orig_T;
Error_Msg_NE
- ("?useless conversion, & has this type!", N, Entity (Orig_N));
+ ("?redundant conversion, & is of type &!", N, Entity (Orig_N));
end if;
end if;
("\?Program_Error will be raised at run time", Operand);
else
- Error_Msg_N
- ("cannot convert local pointer to non-local access type",
- Operand);
+ -- Avoid generation of spurious error message
+
+ if not Error_Posted (N) then
+ Error_Msg_N
+ ("cannot convert local pointer to non-local access type",
+ Operand);
+ end if;
+
return False;
end if;