Complete previous patch; required to avoid regressions in GNATProve.
gcc/ada/ChangeLog:
* sem_ch6.adb (Analyze_Expression_Function): Set the parent of
the new node to be the parent of the original to get the proper
context, which is needed for complete error reporting and for
semantic analysis. Patch suggested by Eric Botcazou.
-- As elsewhere, we do not emit freeze nodes within a generic unit.
if not Inside_A_Generic then
+ -- Set the parent of the new node to be the parent of the original
+ -- to get the proper context, which is needed for complete error
+ -- reporting and for semantic analysis.
+
+ Set_Parent (New_Body, Parent (N));
+
Freeze_Expr_Types
(Def_Id => Def_Id,
Typ => Typ,