diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-11-12 12:52:59 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-11-12 12:52:59 +0100 |
commit | 549cc9c2bcb93b5424c9a0967016d4e51e587311 (patch) | |
tree | e3316f28c5129d8661e41c313965dd0c973deda3 /gcc/ada/sem_ch8.adb | |
parent | b3083540f530b6e28e57756e23c98670f69df4af (diff) | |
download | gcc-549cc9c2bcb93b5424c9a0967016d4e51e587311.zip gcc-549cc9c2bcb93b5424c9a0967016d4e51e587311.tar.gz gcc-549cc9c2bcb93b5424c9a0967016d4e51e587311.tar.bz2 |
[multiple changes]
2015-11-12 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Find_Selected_Component): In a synchronized
body, a reference to an operation of an object of the same
synchronized type was always interpreted as a reference to the
current instance. This is not always the case, as the prefix of
the reference may designate an object of the same type declared
in the enclosing context prior to the body.
2015-11-12 Arnaud Charlet <charlet@adacore.com>
* impunit.ads, impunit.adb (Get_Kind_Of_File): New. Cleaned up
implementation from previous Get_Kind_Of_Unit.
(Get_Kind_Of_Unit): Reimplemented using Get_Kind_Of_File.
* debug.adb: Remove d.4 switch, no longer used.
* opt.ads: Update doc on Debugger_Level.
* gnat1drv.adb: Code clean ups.
* sinput.ads: minor fix in comment
2015-11-12 Bob Duff <duff@adacore.com>
* sinfo.adb, sinfo.ads, sem_ch6.adb, atree.ads: Add
Was_Expression_Function flag, which is set in sem_ch6.adb when
converting an Expression_Function into a Subprogram_Body.
2015-11-12 Pascal Obry <obry@adacore.com>
* usage.adb: Update overflow checking documentation.
From-SVN: r230243
Diffstat (limited to 'gcc/ada/sem_ch8.adb')
-rw-r--r-- | gcc/ada/sem_ch8.adb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index d448712..9e581e0 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -6774,7 +6774,26 @@ package body Sem_Ch8 is -- Prefix denotes an enclosing loop, block, or task, i.e. an -- enclosing construct that is not a subprogram or accept. - Find_Expanded_Name (N); + -- A special case: a protected body may call an operation + -- on an external object of the same type, in which case it + -- is not an expanded name. If the prefix is the type itself, + -- or the context is a single synchronized object it can only + -- be interpreted as an expanded name. + + if Is_Concurrent_Type (Etype (P_Name)) then + if Is_Type (P_Name) + or else Present (Anonymous_Object (Etype (P_Name))) + then + Find_Expanded_Name (N); + + else + Analyze_Selected_Component (N); + return; + end if; + + else + Find_Expanded_Name (N); + end if; elsif Ekind (P_Name) = E_Package then Find_Expanded_Name (N); |