+2015-05-12 Tristan Gingold <gingold@adacore.com>
+
+ * i-cpoint.adb (Copy_Terminated_Array): Copy nothing if Length is 0.
+
+2015-05-12 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Complete_Private_Subtype): Propagate
+ Has_Delayed_Aspects flag from private to full view, to ensure
+ that predicate functions are constructed.
+
+2015-05-12 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Process_Formals): If a tagged formal is an
+ incomplete class-wide type, the subprogram must have a delayed
+ freeze even though the opertation is not a primitive of the
+ type. THis ensures that the backend can recover the full view
+ when elaborating the subprogram declaration.
+
+2015-05-12 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_util.adb (Get_Current_Value_Condition): Nothing to be
+ done if an elsif part has been rewritten so that it is not part
+ of an enclosing if_statement.
+
2015-05-12 Robert Dewar <dewar@adacore.com>
* sem_type.adb, sem_ch10.adb, freeze.adb, sem_ch6.adb, exp_disp.adb:
Stm := Parent (CV);
+ -- If the tree has been otherwise rewritten there is nothing
+ -- else to be done either.
+
+ if Nkind (Stm) /= N_If_Statement then
+ return;
+ end if;
+
-- Before start of ELSIF part
if Loc < Sloc (CV) then
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
raise Dereference_Error;
end if;
- -- Compute array length (including the terminator)
+ -- Compute array limited length (including the terminator)
- L := 1;
- while S.all /= Terminator and then L < Limit loop
+ L := 0;
+ while L < Limit loop
L := L + 1;
+ exit when S.all = Terminator;
Increment (S);
end loop;
-- Freeze the private subtype entity if its parent is delayed, and not
-- already frozen. We skip this processing if the type is an anonymous
-- subtype of a record component, or is the corresponding record of a
- -- protected type, since ???
+ -- protected type, since these are processed when the enclosing type
+ -- is frozen.
if not Is_Type (Scope (Full)) then
Set_Has_Delayed_Freeze (Full,
-- Make sure Has_Predicates is set on full type if it is set on the
-- private type. Note that it may already be set on the full type and
- -- if so, we don't want to unset it.
+ -- if so, we don't want to unset it. Similarly, propagate information
+ -- about delayed aspects, because the corresponding pragmas must be
+ -- analyzed when one of the views is frozen. This last step is needed
+ -- in particular when the full type is a scalar type for which an
+ -- anonymous base type is constructed.
if Has_Predicates (Priv) then
Set_Has_Predicates (Full);
end if;
+
+ if Has_Delayed_Aspects (Priv) then
+ Set_Has_Delayed_Aspects (Full);
+ end if;
end Complete_Private_Subtype;
----------------------------
-- it is still the case that untagged incomplete types cannot
-- be Taft-amendment types and must be completed in private
-- part, so the subprogram must appear in the list of private
- -- dependents of the type.
+ -- dependents of the type. If the type is class-wide, it is
+ -- not a primitive, but the freezing of the subprogram must
+ -- also be delayed to force the creation of a freeze node.
if Is_Tagged_Type (Formal_Type)
or else (Ada_Version >= Ada_2012
then
if Ekind (Scope (Current_Scope)) = E_Package
and then not Is_Generic_Type (Formal_Type)
- and then not Is_Class_Wide_Type (Formal_Type)
then
if not Nkind_In
(Parent (T), N_Access_Function_Definition,
N_Access_Procedure_Definition)
then
- Append_Elmt
- (Current_Scope,
- To => Private_Dependents (Base_Type (Formal_Type)));
+ if not Is_Class_Wide_Type (Formal_Type) then
+ Append_Elmt (Current_Scope,
+ Private_Dependents (Base_Type (Formal_Type)));
+ end if;
-- Freezing is delayed to ensure that Register_Prim
-- will get called for this operation, which is needed