https://gcc.gnu.org/g:9b2a7e42304ee7380be83264f05302c627f01951
commit r17-1641-g9b2a7e42304ee7380be83264f05302c627f01951 Author: Viljar Indus <[email protected]> Date: Wed Jun 3 10:58:11 2026 +0300 ada: Fix ignored ghost withs hiding other implicit withs gcc/ada/ChangeLog: * rtsfind.adb (Maybe_Add_With): Fix skipping implicit withs when only an ignored implicit with exists. Diff: --- gcc/ada/rtsfind.adb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb index 14d32372c80f..77f3d3766f0e 100644 --- a/gcc/ada/rtsfind.adb +++ b/gcc/ada/rtsfind.adb @@ -1292,7 +1292,17 @@ package body Rtsfind is begin Clause := U.First_Implicit_With; while Present (Clause) loop - if Parent (Clause) = Cunit (Current_Sem_Unit) then + + if Parent (Clause) = Cunit (Current_Sem_Unit) + and then + -- Skip when there is a non-ignored with clause already + (not Is_Ignored_Ghost_Node (Clause) + or else + -- Skip if we are going to add a ignored with clause when + -- we already have an ignored with clause. + (Is_Ignored_Ghost_Node (Clause) + and then Ghost_Config.Ghost_Mode = Ignore)) + then return; end if;
