===================================================================
@@ -6251,8 +6251,11 @@
Defining_Identifier => D_T2,
Type_Definition => Def1);
- Insert_After_And_Analyze (N, Decl1);
+ -- Declare the new types before the original one since the latter will
+ -- refer to them through the Equivalent_Type slot.
+ Insert_Before_And_Analyze (N, Decl1);
+
-- Associate the access to subprogram with its original access to
-- protected subprogram type. Needed by the backend to know that this
-- type corresponds with an access to protected subprogram type.
@@ -6286,7 +6289,7 @@
Component_List =>
Make_Component_List (Loc, Component_Items => Comps)));
- Insert_After_And_Analyze (Decl1, Decl2);
+ Insert_Before_And_Analyze (N, Decl2);
Set_Equivalent_Type (T, E_T);
end Expand_Access_Protected_Subprogram_Type;
@@ -9310,6 +9313,9 @@
pragma Assert (Present (Pdef));
+ Insert_After (Current_Node, Rec_Decl);
+ Current_Node := Rec_Decl;
+
-- Add private field components
if Present (Private_Declarations (Pdef)) then
@@ -9570,9 +9576,6 @@
Append_To (Cdecls, Object_Comp);
end if;
- Insert_After (Current_Node, Rec_Decl);
- Current_Node := Rec_Decl;
-
-- Analyze the record declaration immediately after construction,
-- because the initialization procedure is needed for single object
-- declarations before the next entity is analyzed (the freeze call
===================================================================
@@ -7912,11 +7912,11 @@
Scope_Suppress.Suppress := (others => True);
- -- If this is an elementary or a small not-by-reference record type, and
+ -- If this is an elementary or a small not by-reference record type, and
-- we need to capture the value, just make a constant; this is cheap and
-- objects of both kinds of types can be bit aligned, so it might not be
-- possible to generate a reference to them. Likewise if this is not a
- -- name reference, except for a type conversion, because we would enter
+ -- name reference, except for a type conversion because we would enter
-- an infinite recursion with Checks.Apply_Predicate_Check if the target
-- type has predicates (and type conversions need a specific treatment
-- anyway, see below). Also do it if we have a volatile reference and
@@ -8839,7 +8839,7 @@
-- alignment is known to be at least the maximum alignment for the
-- target or if both alignments are known and the output type's
-- alignment is no stricter than the input's. We can use the component
- -- type alignement for an array if a type is an unpacked array type.
+ -- type alignment for an array if a type is an unpacked array type.
if Present (Alignment_Clause (Otyp)) then
Oalign := Expr_Value (Expression (Alignment_Clause (Otyp)));