-- d_z Enable Put_Image on tagged types
-- d_A Stop generation of ALI file
- -- d_B
+ -- d_B Warn on build-in-place function calls
-- d_C
-- d_D
-- d_E
-- d_A Do not generate ALI files by setting Opt.Disable_ALI_File.
+ -- d_B Warn on build-in-place function calls. This allows users to
+ -- inspect their code in case it triggers compiler bugs related
+ -- to build-in-place calls. See known-problem entries for details.
+
-- d_F The compiler encodes the full path from an invocation construct to
-- an external target, offering additional information to GNATBIND for
-- purposes of error diagnostics.
-- out of. This ensures that the secondary stack is not released; otherwise
-- the function result would be reclaimed before returning to the caller.
+ procedure Warn_BIP (Func_Call : Node_Id);
+ -- Give a warning on a build-in-place function call if the -gnatd_B switch
+ -- was given.
+
----------------------------------------------
-- Add_Access_Actual_To_Build_In_Place_Call --
----------------------------------------------
raise Program_Error;
end if;
+ Warn_BIP (Func_Call);
+
Result_Subt := Available_View (Etype (Function_Id));
-- Create a temp for the function result. In the caller-allocates case,
raise Program_Error;
end if;
+ Warn_BIP (Func_Call);
+
Result_Subt := Etype (Function_Id);
-- If the build-in-place function returns a controlled object, then the
raise Program_Error;
end if;
+ Warn_BIP (Func_Call);
+
Result_Subt := Etype (Func_Id);
-- When the result subtype is unconstrained, an additional actual must
Set_Is_Expanded_Build_In_Place_Call (Func_Call);
+ Warn_BIP (Func_Call);
+
-- Create an access type designating the function's result subtype.
-- We use the type of the original call because it may be a call to an
-- inherited operation, which the expansion has replaced with the parent
return Unqual_BIP_Function_Call (Expr);
end Unqual_BIP_Iface_Function_Call;
+ --------------
+ -- Warn_BIP --
+ --------------
+
+ procedure Warn_BIP (Func_Call : Node_Id) is
+ begin
+ if Debug_Flag_Underscore_BB then
+ Error_Msg_N ("build-in-place function call?", Func_Call);
+ end if;
+ end Warn_BIP;
+
end Exp_Ch6;