@@ -3401,6 +3401,18 @@
-- It is unclear why this should make it acceptable to gcc. ???
+ elsif not Is_Constrained (T)
+ and then Has_Discriminants (T)
+ and then Constant_Present (N)
+ and then not Has_Unchecked_Union (T)
+ and then Nkind (E) = N_Aggregate
+ -- If this is a constant declaration of an unconstrained type and
+ -- the initialization is an aggregate, we can use the subtype of the
+ -- aggregate for the declared entity because it is immutable.
+ Act_T := Etype (E);
-- Check No_Wide_Characters restriction