]> git.feebdaed.xyz Git - 0xmirror/gcc.git/commitdiff
Ada: Adjust fix for internal error on illegal aggregate for private type
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 26 Dec 2025 22:10:15 +0000 (23:10 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 26 Dec 2025 22:10:15 +0000 (23:10 +0100)
This adds a more robust guard to Resolve_Record_Aggregate.

gcc/ada/
PR ada/123088
* sem_aggr.adb (Resolve_Record_Aggregate): Add more robust guard.

gcc/ada/sem_aggr.adb

index 308bca6029896711f4e63ecc42017c8d2c3f2460..729835053ede466456edee62800e9e6152af5c99 100644 (file)
@@ -6645,10 +6645,10 @@ package body Sem_Aggr is
 
          --  Typ is not a derived tagged type
 
-         else
+         elsif Nkind (Parent (Base_Type (Typ))) = N_Full_Type_Declaration then
             Record_Def := Type_Definition (Parent (Base_Type (Typ)));
 
-            if No (Record_Def) or else Null_Present (Record_Def) then
+            if Null_Present (Record_Def) then
                null;
 
             --  Explicitly add here mutably class-wide types because they do