procedure Expand_Pragma_Inspection_Point (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
- A : List_Id;
- Assoc : Node_Id;
- E : Entity_Id;
- Rip : Boolean;
- S : Entity_Id;
+ A : List_Id;
+ Assoc : Node_Id;
+ Faulty_Arg : Node_Id := Empty;
+ E : Entity_Id;
+ S : Entity_Id;
begin
if No (Pragma_Argument_Associations (N)) then
-- Process the arguments of the pragma
- Rip := False;
Assoc := First (Pragma_Argument_Associations (N));
while Present (Assoc) loop
-- The back end may need to take the address of the object
("??inspection point references unfrozen object &",
Assoc,
Entity (Expression (Assoc)));
- Rip := True;
+ Faulty_Arg := Assoc;
end if;
Next (Assoc);
-- When the above requirement isn't met, turn the pragma into a no-op
- if Rip then
- Error_Msg_N ("\pragma will be ignored", N);
+ if Present (Faulty_Arg) then
+ Error_Msg_Sloc := Sloc (Faulty_Arg);
+ Error_Msg_N ("\pragma Inspection_Point # will be ignored",
+ Faulty_Arg);
-- We can't just remove the pragma from the tree as it might be
-- iterated over by the caller. Turn it into a null statement