aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2007-09-26 12:46:43 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-09-26 12:46:43 +0200
commit1cc40a1063aa7b00784da59111d9bb9a770929c1 (patch)
tree831c62413daa29b6c04ccb0ae93731c5a423c13d /gcc/ada
parente65f50ec35d3a47891a5dc5ddc06db239139e399 (diff)
downloadgcc-1cc40a1063aa7b00784da59111d9bb9a770929c1.zip
gcc-1cc40a1063aa7b00784da59111d9bb9a770929c1.tar.gz
gcc-1cc40a1063aa7b00784da59111d9bb9a770929c1.tar.bz2
sem_warn.adb (Check_References): Catch more cases of unreferenced packages.
2007-09-26 Robert Dewar <dewar@adacore.com> * sem_warn.adb (Check_References): Catch more cases of unreferenced packages. From-SVN: r128805
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_warn.adb19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 2869cfd..3faf9cb 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -1140,14 +1140,21 @@ package body Sem_Warn is
Ekind (E1) = E_Named_Real
or else
Is_Overloadable (E1)
+
+ -- Package case, if the main unit is a package
+ -- spec or generic package spec, then there may
+ -- be a corresponding body that references this
+ -- package in some other file. Otherwise we can
+ -- be sure that there is no other reference.
+
or else
(Ekind (E1) = E_Package
- and then
- (Ekind (E) = E_Function
- or else Ekind (E) = E_Package_Body
- or else Ekind (E) = E_Procedure
- or else Ekind (E) = E_Subprogram_Body
- or else Ekind (E) = E_Block)))
+ and then
+ Ekind (Cunit_Entity (Current_Sem_Unit)) /=
+ E_Package
+ and then
+ Ekind (Cunit_Entity (Current_Sem_Unit)) /=
+ E_Generic_Package))
-- Exclude instantiations, since there is no reason why every
-- entity in an instantiation should be referenced.