Commit 3a5de596 by Bob Duff Committed by Arnaud Charlet

sem_ch10.adb (Expand_With_Clause): Don't recurse on the prefix if the current…

sem_ch10.adb (Expand_With_Clause): Don't recurse on the prefix if the current with-ed name refers to a package...

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
parent 4460a9bc
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> 2014-01-20 Yannick Moy <moy@adacore.com>
* exp_spark.adb (Expand_SPARK_Call): Remove procedure. * exp_spark.adb (Expand_SPARK_Call): Remove procedure.
......
...@@ -3045,7 +3045,13 @@ package body Sem_Ch10 is ...@@ -3045,7 +3045,13 @@ package body Sem_Ch10 is
Mark_Rewrite_Insertion (Withn); Mark_Rewrite_Insertion (Withn);
Install_Withed_Unit (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); Expand_With_Clause (Item, Prefix (Nam), N);
end if; end if;
end Expand_With_Clause; end Expand_With_Clause;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment