mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-11 10:05:02 +08:00
ada: Cannot reference ghost entity in class-wide precondition
gcc/ada/ * ghost.adb (Is_OK_Declaration): A reference to a Ghost entity may appear within the class-wide precondition of a helper subprogram. This context is treated as suitable because it was already verified when we were analyzing the original class-wide precondition.
This commit is contained in:
parent
e1e2b00703
commit
930b81af5b
@ -261,6 +261,16 @@ package body Ghost is
|
||||
then
|
||||
return True;
|
||||
|
||||
-- A reference to a Ghost entity may appear within the class-wide
|
||||
-- precondition of a helper subprogram. This context is treated
|
||||
-- as suitable because it was already verified when we were
|
||||
-- analyzing the original class-wide precondition.
|
||||
|
||||
elsif Is_Subprogram (Current_Scope)
|
||||
and then Present (Class_Preconditions_Subprogram (Current_Scope))
|
||||
then
|
||||
return True;
|
||||
|
||||
-- References to Ghost entities may be relocated in internally
|
||||
-- generated bodies.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user