]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Implement SPARK RM 6.9 (23)
authorViljar Indus <indus@adacore.com>
Tue, 10 Feb 2026 10:04:31 +0000 (12:04 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 26 May 2026 08:38:23 +0000 (10:38 +0200)
commitd256dc768066fabd41a672bbedf303d64d606436
tree690a4efb053230f3f4d3f6c228d5022cebced81e
parent6a23ada5e3cd2c2757dfcd9779fb3dd1e5eaec57
ada: Implement SPARK RM 6.9 (23)

Implement the rule 23 for ghost code:

A user-defined primitive equality operation on a non-ghost record type shall
not be ghost, unless the record type has only limited views.
In addition, a user-defined primitive equality operation on a ghost record type
shall have a matching assertion level.

gcc/ada/ChangeLog:

* ghost.adb (Check_Ghost_Equality_Op): New function for the
implementation of the rule.
* ghost.ads (Check_Ghost_Equality_Op): Likewise.
* sem_ch6.adb (Valid_Operator_Definition): Add check for rule 23.
gcc/ada/ghost.adb
gcc/ada/ghost.ads
gcc/ada/sem_ch6.adb