From: Javier Miranda <[email protected]>
This patch fixes a regression recently introduced compiling
code under GNATprove mode.
gcc/ada/ChangeLog:
* sem_res.adb (Resolve_Declare_Expression): Do not create a
transient scope under GNATprove mode.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_res.adb | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 3af928ee1e2..33148e935a2 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -7775,6 +7775,7 @@ package body Sem_Res is
-- be needed, we assume the worst case.
if not Preanalysis_Active
+ and then not GNATprove_Mode
and then (Requires_Transient_Scope (Typ)
or else Has_Sec_Stack_Call (Expr))
then
--
2.53.0