diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-12-10 16:42:46 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2025-01-06 10:14:47 +0100 |
commit | 798873d25644bd6c45856dd84d894f9921b5feec (patch) | |
tree | 610d11e83b190897040ad3bc4b9f859d3b5e0df5 /gcc | |
parent | 0216cca155e8abbd711e413d5ea99f3963ab4f43 (diff) | |
download | gcc-798873d25644bd6c45856dd84d894f9921b5feec.zip gcc-798873d25644bd6c45856dd84d894f9921b5feec.tar.gz gcc-798873d25644bd6c45856dd84d894f9921b5feec.tar.bz2 |
ada: Fix crash on Depends contract with homonym functions
When resolving names in flow contracts, we refine the ordinary analysis by
knowing that an overloaded name must refer to an abstract state and not a
function. However, when all overloadings refer to function, we shouldn't
crash, but instead let the error to be diagnosed later.
gcc/ada/ChangeLog:
* sem_prag.adb (Resolve_State): Continue ordinary processing.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_prag.adb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 081716a..1841a0b 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -33804,11 +33804,7 @@ package body Sem_Prag is State := Homonym (State); end loop; - -- A function can never act as a state. If the homonym chain does - -- not contain a corresponding state, then something went wrong in - -- the overloading mechanism. - - raise Program_Error; + -- A function can never act as a state; it will be diagnosed later end if; end if; end Resolve_State; |