]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix bug in resolution of Ghost_Predicate
authorBob Duff <duff@adacore.com>
Mon, 1 Jul 2024 13:23:17 +0000 (09:23 -0400)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 1 Aug 2024 15:14:36 +0000 (17:14 +0200)
commit0a7a8ff2a1d7337fbf76d036b270e36a9230f37b
tree174396799e866fdb7db12754b44137df5720645e
parentba95ced3ac03a0034c5a178343f298849cfe3a10
ada: Fix bug in resolution of Ghost_Predicate

This patch fixes a failure of name resolution when
a range attribute reference appears in a Ghost_Predicate
and the ghost policy is Ignore.

gcc/ada/

* sem_ch13.adb (Add_Predicate): Remove the premature "return;".
Ghost code needs to be processed by later code in this procedure
even when ignored; otherwise the second pass of name resolution
fails much later. However, protect Set_SCO_Pragma_Enabled and
Add_Condition with "if not Is_Ignored_Ghost_Pragma"; these parts
should not happen if the ghost code is Ignored.
* libgnat/interfac__2020.ads (Unsigned_8): Minor reformatting.
* libgnat/interfac.ads (IEEE_Extended_Float): Minor comment
improvement.
gcc/ada/libgnat/interfac.ads
gcc/ada/libgnat/interfac__2020.ads
gcc/ada/sem_ch13.adb