https://gcc.gnu.org/g:35827ca717e3a3552fc513453fd37d1aeb339382

commit r16-1920-g35827ca717e3a3552fc513453fd37d1aeb339382
Author: Piotr Trojanek <troja...@adacore.com>
Date:   Tue May 27 12:17:06 2025 +0200

    ada: Fix ALI elaboration flags for ghost compilation units (cont.)
    
    When GNAT was compiling a ghost unit, the ALI file wrongly suggested that 
this
    unit required elaboration counters, which caused linking errors to 
non-existing
    objects.
    
    gcc/ada/ChangeLog:
    
            * sem_ch10.adb (Analyze_Compilation_Unit): Ignored ghost unit need 
no
            elaboration checks.

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

diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 45aabadf21f8..3a44149aeffc 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -1491,6 +1491,10 @@ package body Sem_Ch10 is
                 --  No checks required if no separate spec
 
                 or else Acts_As_Spec (N)
+
+                --  No checked needed for ignored ghost units
+
+                or else Is_Ignored_Ghost_Entity (Spec_Id)
               )
             then
                --  This is a case where we only need the entity for checking to

Reply via email to