Skip to content
Snippets Groups Projects
Commit 798873d2 authored by Piotr Trojanek's avatar Piotr Trojanek Committed by Marc Poulhiès
Browse files

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.
parent 0216cca1
No related branches found
No related tags found
No related merge requests found
......@@ -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;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment