]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Refactor ghost argument consistency checks
authorViljar Indus <indus@adacore.com>
Fri, 29 Aug 2025 12:09:24 +0000 (15:09 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 15 Sep 2025 12:59:30 +0000 (14:59 +0200)
commit6657536db098d5c388df84162e1f92d159f6f451
tree8fef0d3bb545321aa0effa31385139c5154d646f
parentff94323051f1cb875232b131fcb6a866fbf20e44
ada: Refactor ghost argument consistency checks

Create a new method for checking and emitting errors on pragmas
Unused, Unrefefrenced, Unreferenced_Objects, Inline and No_Return
that support specifying multiple entities as arguments.

Emit an error when one argument is ghost and the other is not and
when one argument has a ghost policy check and the other has ghost
policy ignore.

Update the Suppressed_Ghost_Policy_Check_Pragma list pragma Inline
that should be there to avoid an incorrect invalid pragma context
error.

gcc/ada/ChangeLog:

* sem_prag.adb (Check_Inconsistent_Argument_Ghostliness):
new method for handling the ghost constency errors between
different arguments. Use this method in the processing for
pragmas Unused, Unrefefrenced, Unreferenced_Objects, Inline and
No_Return.
* sem_prag.ads (Suppressed_Ghost_Policy_Check_Pragma): add
missing entry for pragma Inline.
gcc/ada/sem_prag.adb
gcc/ada/sem_prag.ads