diff options
author | Bob Duff <duff@adacore.com> | 2014-01-20 13:48:45 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-20 14:48:45 +0100 |
commit | 3a5de596b6eba17526176085ef7162bab6e88591 (patch) | |
tree | be9f074baa09111d807e3b9f14757ac6d3639b34 /gcc | |
parent | 4460a9bcc2b44c95583242d97a8e8a463706a7e8 (diff) | |
download | gcc-3a5de596b6eba17526176085ef7162bab6e88591.zip gcc-3a5de596b6eba17526176085ef7162bab6e88591.tar.gz gcc-3a5de596b6eba17526176085ef7162bab6e88591.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/sem_ch10.adb | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c40e7e7..9b852db 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +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. diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index b83bf12..6962941 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -3045,7 +3045,13 @@ package body Sem_Ch10 is 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; |