]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix assertion failure on null aggregate in generic with pragma Ada_2022
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 28 Oct 2024 08:56:44 +0000 (09:56 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 12 Nov 2024 13:05:45 +0000 (14:05 +0100)
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.

gcc/ada/sem_aggr.adb

index 9a7d352348e7281810f37ae6c26a17239c55c05c..203d1d017f1251393194714c0e82edac5d016c8d 100644 (file)
@@ -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));