+2012-06-12 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch6.adb: Minor reformatting.
+
+2012-06-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat_ugn.texi: Couple of minor corrections.
+
+2012-06-12 Thomas Quinot <quinot@adacore.com>
+
+ * sem_prag.adb (Check_Variant): An empty component list is not
+ illegal in an unchecked union variant.
+
2012-06-12 Gary Dismukes <dismukes@adacore.com>
* projects.texi: Remove comments.
subprogram and the @option{^-gnatn^/INLINE^} switch is specified; the
subprogram is local to the unit and called once from within it; the
subprogram is small and optimization level @option{-O2} is specified;
-optimization level @option{-O3}) is specified.
+optimization level @option{-O3} is specified.
@end itemize
@noindent
Calls to subprograms in @code{with}'ed units are normally not inlined.
To achieve actual inlining (that is, replacement of the call by the code
-in the body of the subprogram), the following conditions must all be true.
+in the body of the subprogram), the following conditions must all be true:
@itemize @bullet
@item
-- The following is too permissive. A more precise test should
-- check that the generic actual is an ancestor subtype of the
-- other ???.
+
-- See code in Find_Corresponding_Spec that applies an additional
-- filter to handle accidental amiguities in instances.
begin
if Ekind (E) = E_Function
- and then Is_Generic_Actual_Type (Etype (E))
- /= Is_Generic_Actual_Type (Etype (Designator))
+ and then Is_Generic_Actual_Type (Etype (E)) /=
+ Is_Generic_Actual_Type (Etype (Designator))
then
return True;
end if;
F1 := First_Formal (Designator);
F2 := First_Formal (E);
-
while Present (F1) loop
- if
- Is_Generic_Actual_Type (Etype (F1))
- /= Is_Generic_Actual_Type (Etype (F2))
+ if Is_Generic_Actual_Type (Etype (F1)) /=
+ Is_Generic_Actual_Type (Etype (F2))
then
return True;
end if;
if Scope (E) = Current_Scope then
if Current_Scope = Standard_Standard
or else (Ekind (E) = Ekind (Designator)
- and then Type_Conformant (E, Designator))
+ and then Type_Conformant (E, Designator))
then
-- Within an instantiation, we know that spec and body are
-- subtype conformant, because they were subtype conformant in
Comp : Node_Id;
begin
- if not Is_Non_Empty_List (Component_Items (Clist)) then
- Error_Msg_N
- ("Unchecked_Union may not have empty component list",
- Variant);
- return;
- end if;
-
Comp := First (Component_Items (Clist));
while Present (Comp) loop
Check_Component (Comp, UU_Typ, In_Variant_Part => True);