+2015-05-22 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch10.adb (Analyze_With_Clause): In ASIS_Mode, a
+ limited_with clause on a predefined unit is not transformed into
+ a regular with_clause, to preserve the original tree structure.
+ * sinfo.ads (N_With_Clause): Add comment on handling of
+ Limited_With.
+ * sem_ch10.adb: Minor reformatting.
+
+2015-05-22 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Freeze_Profile): A limited view of a type in
+ the profile of a subprogram renaming does not require freezing,
+ because it is declared in a different unit.
+
+2015-05-22 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_aggr.adb (Get_Constraint_Association): If type (of ancestor
+ composite type) is private, go to full view. This was previously
+ done only in an instance context, but is happen whenever a chain
+ of private extensions includes one inherited discriminant.
+
2015-05-22 Robert Dewar <dewar@adacore.com>
* einfo.ads: Minor comment updates.
begin
Typ := T;
- -- Handle private types in instances
+ -- If type is private, get constraint from full view. This was
+ -- previously done in an instance context, but is needed whenever
+ -- the ancestor part has a discriminant, possibly inherited through
+ -- multiple derivations.
- if In_Instance
- and then Is_Private_Type (Typ)
- and then Present (Full_View (Typ))
- then
+ if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then
Typ := Full_View (Typ);
end if;
Indic := Subtype_Indication (Type_Definition (Parent (Typ)));
- -- ??? Also need to cover case of a type mark denoting a subtype
- -- with constraint.
+ -- Verify that the subtype indication carries a constraint
if Nkind (Indic) = N_Subtype_Indication
and then Present (Constraint (Indic))
if Sloc (U) /= No_Location then
if Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (U)))
+
+ -- In ASIS mode the rtsfind mechanism plays no role, and
+ -- we need to maintain the original tree structure, so
+ -- this transformation is not performed in this case.
+
+ and then not ASIS_Mode
then
Set_Limited_Present (N, False);
Analyze_With_Clause (N);
end loop;
if Ekind (Formal_Spec) = E_Function
- and then Ekind (Etype (Formal_Spec)) = E_Incomplete_Type
- and then not Is_Tagged_Type (Etype (F))
+ and then not Is_Tagged_Type (Etype (Formal_Spec))
then
Has_Untagged_Inc := True;
end if;
or else Is_Generic_Type (Root_Type (Etype (F)))
then
null;
+
+ -- A limited view of a type declared elsewhere needs no
+ -- freezing actions.
+
+ elsif From_Limited_With (Etype (F)) then
+ null;
+
else
Error_Msg_NE
("type& must be frozen before this point",
-- simply ignore these nodes, since they are not relevant to the task
-- of back annotating representation information.
+ -- Some other ASIS-specific issues are covered in specific comments in
+ -- sections for particular nodes or flags.
+
----------------
-- Ghost Mode --
----------------
-- Similarly, Private_Present is used to support the implementation of
-- Ada 2005 (AI-50262).
+ -- Note: if the WITH clause refers to a standard library unit, then a
+ -- limited with clause is changed into a normal with clause, because we
+ -- are not prepared to deal with limited with in the context of Rtsfind.
+ -- So in this case, the Limited_Present flag will be False in the final
+ -- tree. However, we do NOT do this transformation in ASIS mode, so for
+ -- ASIS the flag will remain set in this situation.
+
----------------------
-- With_Type clause --
----------------------