[Ada] Get finalization right when a function returns a function call
gcc/ada/
* checks.adb (Apply_Predicate_Check): Generate "infinite
recursion" warning message even if run-time predicate checking
is disabled.
* exp_ch6.adb (Expand_Simple_Function_Return): In testing
whether the returned expression is a function call, look for the
case where the call has been transformed into a dereference of
an access value that designates the result of a function call.
* sem_ch3.adb (Analyze_Object_Declaration): Legality checking
for a static expression is unaffected by assertion policy (and,
in particular, enabling/disabling of subtype predicates. To get
the right legality checking, we need to call
Check_Expression_Against_Static_Predicate for a static
expression even if predicate checking is disabled for the given
predicate-bearing subtype. On the other hand, we don't want to
call Make_Predicate_Check unless predicate checking is enabled.
* sem_ch7.adb (Uninstall_Declarations.Preserve_Full_Attributes):
Preserve the Predicates_Ignored attribute.
* sem_eval.adb (Check_Expression_Against_Static_Predicate):
Previously callers ensured that this procedure was only called
if predicate checking was enabled; that is no longer the case,
so predicates-disabled case must be handled.
* sem_prag.adb (Analyze_Pragma): Fix bug in setting
Predicates_Ignored attribute in Predicate pragma case.