]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix expanding container aggregates
authorViljar Indus <indus@adacore.com>
Tue, 6 Jun 2023 11:55:04 +0000 (14:55 +0300)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 27 Jun 2023 12:05:49 +0000 (14:05 +0200)
Ensure that that container aggregate expressions are expanded as
such and not as records even if the type of the expression is a
record.

gcc/ada/

* exp_aggr.adb (Expand_N_Aggregate): Ensure that container
aggregate expressions do not get expanded as records but instead
as container aggregates.

gcc/ada/exp_aggr.adb

index 5e22fefbc1de76eaf3c769be7d5e356535ebf404..d922c3bf1a443a3c51af8baae04fdf2a7762ca38 100644 (file)
@@ -6463,6 +6463,7 @@ package body Exp_Aggr is
 
       if Is_Record_Type (T)
         and then not Is_Private_Type (T)
+        and then not Is_Homogeneous_Aggregate (N)
       then
          Expand_Record_Aggregate (N);