]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Adjust previous change to Expand_Subtype_From_Expr
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 13 Jul 2022 23:25:25 +0000 (01:25 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 2 Sep 2022 07:34:07 +0000 (09:34 +0200)
An aggregate may have been rewritten before being seen by the procedure.

gcc/ada/

* exp_util.adb (Expand_Subtype_From_Expr): Be prepared for
rewritten aggregates as expressions.

gcc/ada/exp_util.adb

index a8636bbe55da56f3691b4ed4f64f80a48ed5c335..0a0ae93dc21b2ae53ccaf429de3f6137d2bcc52f 100644 (file)
@@ -5741,7 +5741,7 @@ package body Exp_Util is
            --  non-statically-matching subtypes on 'Access of this object.
 
            and then (Nkind (N) /= N_Object_Declaration
-                      or else Nkind (Exp) = N_Aggregate
+                      or else Nkind (Original_Node (Exp)) = N_Aggregate
                       or else Is_Constr_Subt_For_U_Nominal (Exp_Typ))
          then
             --  Within an initialization procedure, a selected component