+2009-06-22 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Check_Overriding_Indicator): Clean up code, make warning
+ unconditional rather than a style check, because a formal name out of
+ order is suspicious.
+
+2009-06-22 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Locate_Directory): Indicate the project name when
+ creating a directory automatically.
+
+2009-06-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem_ch3.adb (Create_Constrained_Components): For a subtype of an
+ untagged derived type, add a hidden component for every constrained
+ discriminant of the parent type to keep record layout consistent.
+
2009-06-22 Thomas Quinot <quinot@adacore.com>
* exp_ch3.adb: Minor code reorganization (avoid an unnecessary tree
and then Is_Completely_Hidden (Old_Compon)
then
-- This is a shadow discriminant created for a discriminant of
- -- the parent type that is one of several renamed by the same
- -- new discriminant. Give the shadow discriminant an internal
- -- name that cannot conflict with that of visible components.
+ -- the parent type, which needs to be present in the subtype.
+ -- Give the shadow discriminant an internal name that cannot
+ -- conflict with that of visible components.
Set_Chars (New_Compon, New_Internal_Name ('C'));
end if;
-- For an untagged derived subtype, the number of discriminants may
-- be smaller than the number of inherited discriminants, because
- -- several of them may be renamed by a single new discriminant.
- -- In this case, add the hidden discriminants back into the subtype,
- -- because otherwise the size of the subtype is computed incorrectly
- -- in GCC 4.1.
+ -- several of them may be renamed by a single new discriminant or
+ -- constrained. In this case, add the hidden discriminants back into
+ -- the subtype, because they need to be present if the optimizer of
+ -- the GCC 4.x back-end decides to break apart assignments between
+ -- objects using the parent view into member-wise assignments.
Num_Gird := 0;
-- component for the current old discriminant.
New_C := Create_Component (Old_Discr);
- Set_Original_Record_Component (New_C, Old_Discr);
+ Set_Original_Record_Component (New_C, Old_Discr);
end if;
+
+ else
+ -- The constraint has eliminated the old discriminant.
+ -- Introduce a shadow component.
+
+ New_C := Create_Component (Old_Discr);
+ Set_Original_Record_Component (New_C, Old_Discr);
end if;
Next_Elmt (Constr);
-- often carry names that reflect the type, and it is not worthwhile
-- requiring that their names match.
- if Style_Check
- and then Present (Overridden_Subp)
+ if Present (Overridden_Subp)
and then Nkind (Subp) /= N_Defining_Operator_Symbol
then
declare
Form1 := First_Formal (Subp);
Form2 := First_Formal (Overridden_Subp);
+ -- If the overriding operation is a synchronized operation, skip
+ -- the first parameter of the overridden operation, which is
+ -- implicit in the new one.
+
+ if Is_Concurrent_Type (Scope (Subp)) then
+ Form2 := Next_Formal (Form2);
+ end if;
+
if Present (Form1) then
Form1 := Next_Formal (Form1);
Form2 := Next_Formal (Form2);