Don't call Analyse just before Process_Range_Expr_In_Decl, because the
latter starts with a call to Analyze_And_Resolve anyway.

This fixes a violation with the required sequencing in resolution of
overloaded nodes that requires the Etype being Any_Type and
Is_Overloading being False before calling Add_One_Interp for multiple
interpretations.

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

gcc/ada/

        * sem_ch3.adb (Constraint_Index): Remove redundant problematic
        analysis.
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
@@ -14171,8 +14171,6 @@ package body Sem_Ch3 is
       then
          --  A Range attribute will be transformed into N_Range by Resolve
 
-         Analyze (S);
-         Set_Etype (S, T);
          R := S;
 
          Process_Range_Expr_In_Decl (R, T);


Reply via email to