There is no need to build a cleanup if exceptions cannot be propagated.
gcc/ada/ChangeLog:
* exp_ch4.adb (Expand_Allocator_Expression): Do not build a cleanup
if restriction No_Exception_Propagation is active.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Likewise.
and then Nkind (Exp) = N_Function_Call
and then not (Is_Entity_Name (Name (Exp))
and then No_Raise (Entity (Name (Exp))))
+ and then not Restriction_Active (No_Exception_Propagation)
and then RTE_Available (RE_Free)
and then not Debug_Flag_QQ);
-- Return True if a cleanup needs to be built to deallocate the memory
and then not For_Special_Return_Object (Allocator)
and then not (Is_Entity_Name (Name (Func_Call))
and then No_Raise (Entity (Name (Func_Call))))
+ and then not Restriction_Active (No_Exception_Propagation)
and then RTE_Available (RE_Free)
and then not Debug_Flag_QQ
then