aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch7.adb
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2020-06-23 16:12:36 -0700
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-15 05:39:13 -0400
commit8861bdd59a95b32ad6000157418c808317421bfe (patch)
treede485687f008f292939534831d75462525f4e158 /gcc/ada/sem_ch7.adb
parent7e37c1a522eca7dbe88ec58d22a88362df572758 (diff)
downloadgcc-8861bdd59a95b32ad6000157418c808317421bfe.zip
gcc-8861bdd59a95b32ad6000157418c808317421bfe.tar.gz
gcc-8861bdd59a95b32ad6000157418c808317421bfe.tar.bz2
[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.
Diffstat (limited to 'gcc/ada/sem_ch7.adb')
-rw-r--r--gcc/ada/sem_ch7.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index 3ff2001..b389464 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -2725,6 +2725,7 @@ package body Sem_Ch7 is
Set_Has_Pragma_Unreferenced_Objects
(Priv, Has_Pragma_Unreferenced_Objects
(Full));
+ Set_Predicates_Ignored (Priv, Predicates_Ignored (Full));
if Is_Unchecked_Union (Full) then
Set_Is_Unchecked_Union (Base_Type (Priv));
end if;