Skip to content
Snippets Groups Projects
Commit 6be06ae8 authored by Eric Botcazou's avatar Eric Botcazou Committed by Marc Poulhiès
Browse files

ada: Fix assertion failure on 'Old in post-condition with -gnat2022

It comes from a small oversight in the updated implementation for Ada 2022.

gcc/ada/ChangeLog:

	PR ada/117956
	* sem_util.adb (Is_Known_On_Entry): Be prepared for constants coming
	from a renaming declaration.
parent 75e126db
No related branches found
No related tags found
No related merge requests found
...@@ -31188,8 +31188,17 @@ package body Sem_Util is ...@@ -31188,8 +31188,17 @@ package body Sem_Util is
-- removal, e.g. by validity checks. -- removal, e.g. by validity checks.
   
if not Comes_From_Source (Obj) then if not Comes_From_Source (Obj) then
return declare
Is_Known_On_Entry (Expression (Parent (Obj))); D : constant Node_Id :=
Declaration_Node (Obj);
begin
if Nkind (D) = N_Object_Renaming_Declaration
then
return Is_Known_On_Entry (Name (D));
else
return Is_Known_On_Entry (Expression (D));
end if;
end;
end if; end if;
   
-- return False if not "all views are constant". -- return False if not "all views are constant".
......
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