[COMMITTED] ada: Expand generic formal subprograms with contracts for GNATprove

Message ID 20221114135202.52712-1-poulhies@adacore.com
State Committed
Commit fe02d7d9135083ed157886913b4a83ebc88e987c
Headers
Series [COMMITTED] ada: Expand generic formal subprograms with contracts for GNATprove |

Commit Message

Marc Poulhiès Nov. 14, 2022, 1:52 p.m. UTC
  From: Piotr Trojanek <trojanek@adacore.com>

In GNATprove mode generic formal subprograms with Pre/Post contracts are
now expanded into wrappers, just like in ordinary compilation.

gcc/ada/

	* sem_ch12.adb (Analyze_Associations): Expand wrappers for
	GNATprove.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_ch12.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 276656085be..7af365e49c9 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -1937,7 +1937,7 @@  package body Sem_Ch12 is
                      --  take place e.g. within an enclosing generic unit.
 
                      if Has_Contracts (Analyzed_Formal)
-                       and then Expander_Active
+                       and then (Expander_Active or GNATprove_Mode)
                      then
                         Build_Subprogram_Wrappers;
                      end if;