+2011-12-02 Thomas Quinot <quinot@adacore.com>
+
+ * sem_ch10.adb (Analyze_Compilation_Unit): For a library subprogram
+ body that acts as spec, do not create a shallow copy of the context
+ clause for the synthetized spec (instead, use the same list as
+ in the body).
+
2011-12-02 Bob Duff <duff@adacore.com>
* gnat_ugn.texi: Clarify usage of -p binder switch.
begin
Set_Comes_From_Source_Default (False);
+
+ -- Checks for redundant USE TYPE clauses have a special
+ -- exception for the synthetic spec we create here. This
+ -- special case relies on the two compilation units
+ -- sharing the same context clause.
+
+ -- Note: We used to do a shallow copy (New_Copy_List),
+ -- which defeated those checks and also created malformed
+ -- trees (subtype mark shared by two distinct
+ -- N_Use_Type_Clause nodes) which crashed the compiler.
+
Lib_Unit :=
Make_Compilation_Unit (Loc,
- Context_Items => New_Copy_List (Context_Items (N)),
+ Context_Items => Context_Items (N),
Unit =>
Make_Subprogram_Declaration (Sloc (N),
Specification =>