diff options
author | Yannick Moy <moy@adacore.com> | 2016-07-06 13:41:20 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-07-06 15:41:20 +0200 |
commit | 6dfc5e671f592499d162ccf2cadd17b9de9d090c (patch) | |
tree | 9e49a320e95507020be92d4dc488bcc44a4a6609 /gcc/ada | |
parent | d030f3a45173ca7496c50d47e651638e3ff2f00f (diff) | |
download | gcc-6dfc5e671f592499d162ccf2cadd17b9de9d090c.zip gcc-6dfc5e671f592499d162ccf2cadd17b9de9d090c.tar.gz gcc-6dfc5e671f592499d162ccf2cadd17b9de9d090c.tar.bz2 |
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
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/sem_ch6.adb | 9 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 8 |
3 files changed, 16 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8f060ca..98e47fb 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 86083eb..a47ebda 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 3b9d984..f603e317 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). |