https://gcc.gnu.org/g:e23f3612a7bfa660b54485ad6c1515ef2d748406

commit r17-741-ge23f3612a7bfa660b54485ad6c1515ef2d748406
Author: Eric Botcazou <[email protected]>
Date:   Fri Jan 16 19:55:07 2026 +0100

    ada: Fix fallout of latest change to Analyze_Subprogram_Renaming
    
    Replacing the original expression by Expression_Of_Expression_Function is
    not fully equivalent because Expression_Of_Expression_Function returns the
    Original_Node of the expression.
    
    gcc/ada/ChangeLog:
    
            * sem_ch8.adb (Analyze_Subprogram_Renaming): Retrieve again the
            expression of the expression function manually.

Diff:
---
 gcc/ada/sem_ch8.adb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index ff6dcd5eff6a..2aa3021cfa62 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -3555,7 +3555,9 @@ package body Sem_Ch8 is
             Freeze_Expr_Types
               (Def_Id => Entity (Nam),
                Typ    => Etype (Entity (Nam)),
-               Expr   => Expression_Of_Expression_Function (Entity (Nam)),
+               Expr   =>
+                 Expression
+                   (Original_Node (Unit_Declaration_Node (Entity (Nam)))),
                N      => N);
          end if;

Reply via email to