Commit 6dfc5e67 by Yannick Moy Committed by Arnaud Charlet

sem_ch6.adb (Analyze_Expression_Function): Mark body of expression function as…

sem_ch6.adb (Analyze_Expression_Function): Mark body of expression function as ghost if needed when created.

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

	* sem_ch6.adb (Analyze_Expression_Function): Mark body of
	expression function as ghost if needed when created.
	* sem_prag.adb (Analyze_Pragma.Process_Inline.Set_Inline_Flags):
	Remove special case.

From-SVN: r238051
parent d030f3a4
2016-07-06 Yannick Moy <moy@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Mark body of
expression function as ghost if needed when created.
* sem_prag.adb (Analyze_Pragma.Process_Inline.Set_Inline_Flags):
Remove special case.
2016-07-06 Arnaud Charlet <charlet@adacore.com> 2016-07-06 Arnaud Charlet <charlet@adacore.com>
* lib.adb (Check_Same_Extended_Unit): Complete previous change. * lib.adb (Check_Same_Extended_Unit): Complete previous change.
......
...@@ -486,6 +486,15 @@ package body Sem_Ch6 is ...@@ -486,6 +486,15 @@ package body Sem_Ch6 is
Set_Is_Inlined (Defining_Entity (N)); Set_Is_Inlined (Defining_Entity (N));
-- If the expression function is Ghost, mark its body entity as
-- Ghost too. This avoids spurious errors on unanalyzed body entities
-- of expression functions, which are not yet marked as ghost, yet
-- identified as the Corresponding_Body of the ghost declaration.
if Is_Ghost_Entity (Def_Id) then
Set_Is_Ghost_Entity (Defining_Entity (New_Body));
end if;
-- Establish the linkages between the spec and the body. These are -- Establish the linkages between the spec and the body. These are
-- used when the expression function acts as the prefix of attribute -- used when the expression function acts as the prefix of attribute
-- 'Access in order to freeze the original expression which has been -- 'Access in order to freeze the original expression which has been
......
...@@ -9080,14 +9080,6 @@ package body Sem_Prag is ...@@ -9080,14 +9080,6 @@ package body Sem_Prag is
Ghost_Id := Subp; Ghost_Id := Subp;
end if; end if;
-- Do not issue an error on an unanalyzed subprogram body entity.
-- It may lead to spurious errors on unanalyzed body entities of
-- expression functions, which are not yet marked as ghost, yet
-- identified as the Corresponding_Body of the ghost declaration.
elsif Ekind (Subp) = E_Void then
null;
-- Otherwise the subprogram is non-Ghost. It is illegal to mix -- Otherwise the subprogram is non-Ghost. It is illegal to mix
-- references to Ghost and non-Ghost entities (SPARK RM 6.9). -- references to Ghost and non-Ghost entities (SPARK RM 6.9).
......
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