2014-01-20 Bob Duff <duff@adacore.com>
* sem_ch10.adb (Expand_With_Clause): Don't
recurse on the prefix if the current with-ed name refers to a
package that renames its own parent, eg "package P.Q renames P;".
From-SVN: r206807
+2014-01-20 Bob Duff <duff@adacore.com>
+
+ * sem_ch10.adb (Expand_With_Clause): Don't
+ recurse on the prefix if the current with-ed name refers to a
+ package that renames its own parent, eg "package P.Q renames P;".
+
2014-01-20 Yannick Moy <moy@adacore.com>
* exp_spark.adb (Expand_SPARK_Call): Remove procedure.
Mark_Rewrite_Insertion (Withn);
Install_Withed_Unit (Withn);
- if Nkind (Nam) = N_Expanded_Name then
+ -- If we have "with X.Y;", we want to recurse on "X", except in the
+ -- unusual case where X.Y is a renaming of X. In that case, the scope
+ -- of X will be null.
+
+ if Nkind (Nam) = N_Expanded_Name
+ and then Present (Scope (Entity (Prefix (Nam))))
+ then
Expand_With_Clause (Item, Prefix (Nam), N);
end if;
end Expand_With_Clause;