The special inlining in GNATprove mode should recognize specially calls
inside default expressions, which cannot be inlined. This was not done
for calls in default expressions for discriminants, because the right
analysis context was not set in that case. Now fixed.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_ch3.adb (Process_Discriminants): Correctly set right
        context for analyzing default value of discriminant.
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -20093,7 +20093,7 @@ package body Sem_Ch3 is
          --  Per-Object Expressions" in spec of package Sem).
 
          if Present (Expression (Discr)) then
-            Preanalyze_Spec_Expression (Expression (Discr), Discr_Type);
+            Preanalyze_Default_Expression (Expression (Discr), Discr_Type);
 
             --  Legaity checks
 


Reply via email to