+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>
* lib.adb (Check_Same_Extended_Unit): Complete previous change.
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
-- used when the expression function acts as the prefix of attribute
-- 'Access in order to freeze the original expression which has been
Ghost_Id := Subp;
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
-- references to Ghost and non-Ghost entities (SPARK RM 6.9).