aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-04-27 12:00:42 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-04-27 12:00:42 +0200
commit522aa6ee70820727d5be628b0f6b3cc7a185a14b (patch)
treeae207153ba994c3456cf41e612a494ca2c615cdd /gcc/ada/sem_util.adb
parentf138ea5cbaf8f2a8cec00b741e5b23a8db5c0f83 (diff)
downloadgcc-522aa6ee70820727d5be628b0f6b3cc7a185a14b.zip
gcc-522aa6ee70820727d5be628b0f6b3cc7a185a14b.tar.gz
gcc-522aa6ee70820727d5be628b0f6b3cc7a185a14b.tar.bz2
[multiple changes]
2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch8.adb (Find_Direct_Name): Account for the case where a use-visible entity is defined within a nested scope of an instance when giving priority to entities which were visible in the original generic. * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine. 2017-04-27 Tristan Gingold <gingold@adacore.com> * raise-gcc.c: Don't use unwind.h while compiling for the frontend, but mimic host behavior. 2017-04-27 Javier Miranda <miranda@adacore.com> * sem_ch3.adb (Build_Discriminated_Subtype): Propagate Has_Pragma_Unreferenced_Objects to the built subtype. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Global_Item): Do not consider discriminants because they are not "entire objects". Remove the discriminant-related checks because they are obsolete. (Analyze_Input_Output): Do not consider discriminants because they are not "entire objects". 2017-04-27 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not perform check if the current scope does not come from source, as is the case for a rewritten task body, because check has been performed already, and may not be doable because of changed visibility. From-SVN: r247309
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r--gcc/ada/sem_util.adb20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 00dfd6d9..f924b73 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -16750,6 +16750,26 @@ package body Sem_Util is
Mark_Allocators (Root_Nod);
end Mark_Coextensions;
+ --------------------------------
+ -- Nearest_Enclosing_Instance --
+ --------------------------------
+
+ function Nearest_Enclosing_Instance (E : Entity_Id) return Entity_Id is
+ Inst : Entity_Id;
+
+ begin
+ Inst := Scope (E);
+ while Present (Inst) and then Inst /= Standard_Standard loop
+ if Is_Generic_Instance (Inst) then
+ return Inst;
+ end if;
+
+ Inst := Scope (Inst);
+ end loop;
+
+ return Empty;
+ end Nearest_Enclosing_Instance;
+
----------------------
-- Needs_One_Actual --
----------------------