aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/ghost.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/ghost.adb')
-rw-r--r--gcc/ada/ghost.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb
index 42ea0f5..1720fe0 100644
--- a/gcc/ada/ghost.adb
+++ b/gcc/ada/ghost.adb
@@ -584,6 +584,15 @@ package body Ghost is
-- Start of processing for Check_Ghost_Context
begin
+ -- Class-wide pre/postconditions of ignored pragmas are preanalyzed
+ -- to report errors on wrong conditions; however, ignored pragmas may
+ -- also have references to ghost entities and we must disable checking
+ -- their context to avoid reporting spurious errors.
+
+ if Inside_Class_Condition_Preanalysis then
+ return;
+ end if;
+
-- Once it has been established that the reference to the Ghost entity
-- is within a suitable context, ensure that the policy at the point of
-- declaration and at the point of use match.