diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-07 13:47:31 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-07 13:47:31 +0000 |
commit | 7d525f2616db39bd47d9c213de182abee3968213 (patch) | |
tree | 64a829e3ff948170473eeee464b5cd264f7144fd /gcc/ada/inline.adb | |
parent | 6ff1f3e25f84f58c348b0e6b0b539aaf200b1195 (diff) | |
download | gcc-7d525f2616db39bd47d9c213de182abee3968213.tar.gz |
2014-11-07 Hristian Kirtchev <kirtchev@adacore.com>
* freeze.adb (Freeze_Entity): Issue an error regardless of the
SPARK_Mode when a ghost type is effectively volatile.
* sem_ch3.adb (Analyze_Object_Contract): Decouple the checks
related to Ghost from SPARK_Mode.
* sem_res.adb (Check_Ghost_Policy): Issue an error regardless
of the SPARK_Mode when the Ghost policies do not match.
* sem_util.adb (Check_Ghost_Completion): Issue an error regardless
of the SPARK_Mode when the Ghost policies do not match.
2014-11-07 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): return if name
in iterator does not have any usable aspect for iteration.
2014-11-07 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Analyze_Null_Procedure): Reject a null procedure
that there is a previous null procedure in scope with a matching
profile.
2014-11-07 Hristian Kirtchev <kirtchev@adacore.com>
* atree.adb (Copy_Separate_Tree): Copy the aspect specifications.
* inline.adb (Has_Some_Contract): Do the check only when the
related entity has been analyzed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217224 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r-- | gcc/ada/inline.adb | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 9646cc2fdc7..812002b4ed0 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -1316,12 +1316,23 @@ package body Inline is ----------------------- function Has_Some_Contract (Id : Entity_Id) return Boolean is - Items : constant Node_Id := Contract (Id); + Items : Node_Id; + begin - return Present (Items) - and then (Present (Pre_Post_Conditions (Items)) or else - Present (Contract_Test_Cases (Items)) or else - Present (Classifications (Items))); + -- A call to an expression function may precede the actual body which + -- is inserted at the end of the enclosing declarations. Ensure that + -- the related entity is analyzed before inspecting the contract. + + if Analyzed (Id) then + Items := Contract (Id); + + return Present (Items) + and then (Present (Pre_Post_Conditions (Items)) or else + Present (Contract_Test_Cases (Items)) or else + Present (Classifications (Items))); + end if; + + return False; end Has_Some_Contract; ----------------------------- |