aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/freeze.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2015-05-22 12:31:03 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2015-05-22 14:31:03 +0200
commita79cdb2c620b61aeb397eb546a790b106dd230ca (patch)
tree638f2ee6139a63b863340159c5252116a8608257 /gcc/ada/freeze.adb
parentdb222eadb159ec04d1e7884c701e61e99e7e37c2 (diff)
downloadgcc-a79cdb2c620b61aeb397eb546a790b106dd230ca.zip
gcc-a79cdb2c620b61aeb397eb546a790b106dd230ca.tar.gz
gcc-a79cdb2c620b61aeb397eb546a790b106dd230ca.tar.bz2
freeze.adb (Freeze_Profile): Suppress warning if imported subprogram is not at library level.
2015-05-22 Bob Duff <duff@adacore.com> * freeze.adb (Freeze_Profile): Suppress warning if imported subprogram is not at library level. From-SVN: r223549
Diffstat (limited to 'gcc/ada/freeze.adb')
-rw-r--r--gcc/ada/freeze.adb15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index f324981..1c4615b 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -3357,9 +3357,20 @@ package body Freeze is
end if;
end if;
- -- Check suspicious use of Import in pure unit
+ -- Check suspicious use of Import in pure unit (cases where the RM
+ -- allows calls to be omitted).
- if Is_Imported (E) and then Is_Pure (Cunit_Entity (Current_Sem_Unit))
+ if Is_Imported (E)
+
+ -- It might be suspicious if the compilation unit has the Pure
+ -- aspect/pragma.
+
+ and then Has_Pragma_Pure (Cunit_Entity (Current_Sem_Unit))
+
+ -- The RM allows omission of calls only in the case of
+ -- library-level subprograms (see RM-10.2.1(18)).
+
+ and then Is_Library_Level_Entity (E)
-- Ignore internally generated entity. This happens in some cases
-- of subprograms in specs, where we generate an implied body.