Commit 0bb97bdf by Yannick Moy Committed by Arnaud Charlet

sem_ch6.adb (Process_Formals): Set ghost flag on formal entities of ghost subprograms.

2016-07-07  Yannick Moy  <moy@adacore.com>

	* sem_ch6.adb (Process_Formals): Set ghost flag
	on formal entities of ghost subprograms.
	* ghost.adb (Check_Ghost_Context.Is_OK_Ghost_Context): Accept ghost
	entities in use type clauses.

From-SVN: r238106
parent f965d3da
2016-07-07 Yannick Moy <moy@adacore.com>
* sem_ch6.adb (Process_Formals): Set ghost flag
on formal entities of ghost subprograms.
* ghost.adb (Check_Ghost_Context.Is_OK_Ghost_Context): Accept ghost
entities in use type clauses.
2016-07-06 Javier Miranda <miranda@adacore.com> 2016-07-06 Javier Miranda <miranda@adacore.com>
* sem_ch6.adb (Check_Inline_Pragma): if the subprogram has no spec * sem_ch6.adb (Check_Inline_Pragma): if the subprogram has no spec
......
...@@ -469,6 +469,14 @@ package body Ghost is ...@@ -469,6 +469,14 @@ package body Ghost is
if Ghost_Mode > None then if Ghost_Mode > None then
return True; return True;
-- A Ghost type may be referenced in a use_type clause
-- (SPARK RM 6.9.10).
elsif Present (Parent (Context))
and then Nkind (Parent (Context)) = N_Use_Type_Clause
then
return True;
-- Routine Expand_Record_Extension creates a parent subtype without -- Routine Expand_Record_Extension creates a parent subtype without
-- inserting it into the tree. There is no good way of recognizing -- inserting it into the tree. There is no good way of recognizing
-- this special case as there is no parent. Try to approximate the -- this special case as there is no parent. Try to approximate the
......
...@@ -10975,6 +10975,13 @@ package body Sem_Ch6 is ...@@ -10975,6 +10975,13 @@ package body Sem_Ch6 is
Set_Etype (Formal, Formal_Type); Set_Etype (Formal, Formal_Type);
-- A formal parameter declared within a Ghost region is automatically
-- Ghost (SPARK RM 6.9(2)).
if Ghost_Mode > None then
Set_Is_Ghost_Entity (Formal);
end if;
-- Deal with default expression if present -- Deal with default expression if present
Default := Expression (Param_Spec); Default := Expression (Param_Spec);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment