diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-08 09:22:59 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-08 09:22:59 +0000 |
commit | cdf5fa94668a12ff09f3c054557a28f92e32fd06 (patch) | |
tree | 8311392e23e919d341d6291f43cbacbdcc5827c2 /gcc/ada/sem_util.adb | |
parent | a1a88d237841b808b2b69944a89f4b74810730cd (diff) | |
download | gcc-cdf5fa94668a12ff09f3c054557a28f92e32fd06.tar.gz |
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* sem_util.ads, sem_util.adb (Is_CCT_Instance): Only expect
entities of named concurrent types as Ref_Id and not of anonymous
concurrent objects (because callers already know when a conversion
is necessary and can easily do it); also, do not expect protected
types or protected objects as Context_Id (because no flow-related
SPARK pragmas are attached there); reflect these changes in a
more precise comment.
2017-09-08 Olivier Hainque <hainque@adacore.com>
* g-altive.ads: Add documentation.
2017-09-08 Bob Duff <duff@adacore.com>
* sem_util.ads, debug.adb: Minor comment fix.
* erroutc.ads: Comment fix.
2017-09-08 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Validate_Array_Type_Instance): Suppress check
for compatibility of component types of formal and actual in an
instantiation of a child unit, when the component type of the
formal is itself a formal of an enclosing generic.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251872 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r-- | gcc/ada/sem_util.adb | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 8fe3e1ada79..465d1412e3f 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -12391,38 +12391,17 @@ package body Sem_Util is Context_Id : Entity_Id) return Boolean is begin - pragma Assert - (Is_Entry (Context_Id) - or else - Ekind_In (Context_Id, E_Function, - E_Procedure, - E_Protected_Type, - E_Task_Type) - or else - Is_Single_Concurrent_Object (Context_Id)); - - -- When the reference denotes a single protected type, the context is - -- either a protected subprogram or its body. - - if Is_Single_Protected_Object (Ref_Id) then - return Scope_Within (Context_Id, Etype (Ref_Id)); - - -- When the reference denotes a single task type, the context is either - -- the same type or if inside the body, the anonymous task object. - - elsif Is_Single_Task_Object (Ref_Id) then - if Is_Single_Task_Object (Context_Id) then - return Context_Id = Ref_Id; - - elsif Ekind (Context_Id) = E_Task_Type then - return Context_Id = Etype (Ref_Id); - - else - return Scope_Within_Or_Same (Context_Id, Etype (Ref_Id)); - end if; + pragma Assert (Ekind_In (Ref_Id, E_Protected_Type, E_Task_Type)); + if Is_Single_Task_Object (Context_Id) then + return Scope_Within_Or_Same (Etype (Context_Id), Ref_Id); else - pragma Assert (Ekind_In (Ref_Id, E_Protected_Type, E_Task_Type)); + pragma Assert + (Is_Entry (Context_Id) + or else + Ekind_In (Context_Id, E_Function, + E_Procedure, + E_Task_Type)); return Scope_Within_Or_Same (Context_Id, Ref_Id); end if; |