diff options
author | Yannick Moy <moy@adacore.com> | 2022-05-16 09:58:18 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-06-02 09:06:42 +0000 |
commit | 017f48682c2498b4cde79cf6a1c2e09b6ad51e02 (patch) | |
tree | 874fb70a66dab0ac3beb4f86647ab39857d985f1 /gcc | |
parent | a9f5f2cd642689ae58f27aa23dff5c8d7c7bb016 (diff) | |
download | gcc-017f48682c2498b4cde79cf6a1c2e09b6ad51e02.zip gcc-017f48682c2498b4cde79cf6a1c2e09b6ad51e02.tar.gz gcc-017f48682c2498b4cde79cf6a1c2e09b6ad51e02.tar.bz2 |
[Ada] Fix spurious errors on ghost code in generics
After the recent fix for detecting illegal use of ghost entities in
code, spurious errors could be raised on generic code with ghost, due to
wrong setting of the ghost flags on copied entities from the generic to
the instantiation.
gcc/ada/
* atree.adb (New_Copy): Reset flags related to ghost entities
before marking the new node.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/atree.adb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index a949761..2d7962c 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -1775,6 +1775,11 @@ package body Atree is -- Mark the copy as Ghost depending on the current Ghost region + if Nkind (New_Id) in N_Entity then + Set_Is_Checked_Ghost_Entity (New_Id, False); + Set_Is_Ignored_Ghost_Entity (New_Id, False); + end if; + Mark_New_Ghost_Node (New_Id); New_Node_Debugging_Output (New_Id); |