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

commit r15-5157-gfbbfad022c2f5bc6b481b41bd32faa278e343474
Author: Eric Botcazou <ebotca...@adacore.com>
Date:   Mon Oct 28 09:56:44 2024 +0100

    ada: Fix assertion failure on null aggregate in generic with pragma Ada_2022
    
    This happens when the unit is instantiated in a non-Ada 2022 unit.
    
    gcc/ada/ChangeLog:
    
            PR ada/114127
            * sem_aggr.adb (Is_Null_Aggregate): Replace test on Ada_Version
            with test on Nkind.

Diff:
---
 gcc/ada/sem_aggr.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 9a7d352348e7..203d1d017f12 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1067,7 +1067,7 @@ package body Sem_Aggr is
 
    function Is_Null_Aggregate (N : Node_Id) return Boolean is
    begin
-      return Ada_Version >= Ada_2022
+      return Nkind (N) = N_Aggregate
         and then Is_Homogeneous_Aggregate (N)
         and then Is_Empty_List (Expressions (N))
         and then Is_Empty_List (Component_Associations (N));

Reply via email to