]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix fallout of latest change to Analyze_Subprogram_Renaming
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 16 Jan 2026 18:55:07 +0000 (19:55 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 25 May 2026 08:28:11 +0000 (10:28 +0200)
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.

gcc/ada/sem_ch8.adb

index ff6dcd5eff6a87f6450fe310086018a0844300b1..2aa3021cfa628913a654743a896fe751425d165a 100644 (file)
@@ -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;