aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-06 13:41:20 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-06 13:41:20 +0000
commit7a37e21f7803d0b6348de6f74faa3398588f0250 (patch)
tree9e49a320e95507020be92d4dc488bcc44a4a6609
parent61989dbb3e1d24cc68a3af66a984cec65cdca418 (diff)
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238051 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/sem_ch6.adb9
-rw-r--r--gcc/ada/sem_prag.adb8
3 files changed, 16 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 8f060caf8ab..98e47fbc758 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+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.
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 86083eb6955..a47ebda2807 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -486,6 +486,15 @@ package body Sem_Ch6 is
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
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 3b9d9841f47..f603e317af4 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -9080,14 +9080,6 @@ package body Sem_Prag is
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).