or else Is_Invariant_Procedure (Current_Subprogram)
or else Is_DIC_Procedure (Current_Subprogram))
then
- if Present (Body_Id)
- and then Present (Body_To_Inline (Nam_Decl))
- then
+ declare
+ Issue_Msg : constant Boolean :=
+ Present (Body_Id)
+ and then Present (Body_To_Inline (Nam_Decl));
+ begin
if Is_Predicate_Function (Current_Subprogram) then
Cannot_Inline
("cannot inline & (inside predicate)?",
- N, Nam_UA);
+ N, Nam_UA, Suppress_Info => not Issue_Msg);
elsif Is_Invariant_Procedure (Current_Subprogram) then
Cannot_Inline
("cannot inline & (inside invariant)?",
- N, Nam_UA);
+ N, Nam_UA, Suppress_Info => not Issue_Msg);
elsif Is_DIC_Procedure (Current_Subprogram) then
Cannot_Inline
("cannot inline & (inside Default_Initial_Condition)?",
- N, Nam_UA);
+ N, Nam_UA, Suppress_Info => not Issue_Msg);
else
Cannot_Inline
("cannot inline & (inside expression function)?",
- N, Nam_UA);
+ N, Nam_UA, Suppress_Info => not Issue_Msg);
end if;
- end if;
+ end;
-- Cannot inline a call inside the definition of a record type,
-- typically inside the constraints of the type. Calls in