From: Eric Botcazou <[email protected]>
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.
Tested on x86_64-pc-linux-gnu, committed on master.
---
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 9a7d352348e..203d1d017f1 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));
--
2.43.0