summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-13 11:18:17 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-13 11:18:17 +0000
commit008e1d8fd6c558dad4a3e0bc04d603099e67bc7f (patch)
treeb7e91134756cbe01e7e670535cf4f42b0d0b0514 /gcc/ada/sem_ch4.adb
parenta6a80ba0acf90ddf55485cddff62a7dee785a0ba (diff)
downloadgcc-008e1d8fd6c558dad4a3e0bc04d603099e67bc7f.tar.gz
2015-11-13 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Constant_Indexing_OK): If the indexing is the prefix of a procedure call assume that constant indexing is not chosen. 2015-11-13 Eric Botcazou <ebotcazou@adacore.com> * sigtramp.h: Fix formatting throughout, do not include other headers, add missing preprocessor condition and 'extern' keywords. * sigtramp-armdroid.c: Include <sys/ucontext.h>. * init.c [Android]: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230304 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 373c9e86fae..1b14550ba74 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -7296,7 +7296,8 @@ package body Sem_Ch4 is
-- If the indexed component is a prefix it may be the first actual
-- of a prefixed call. Retrieve the called entity, if any, and
- -- check its first formal.
+ -- check its first formal. Determine if the context is a procedure
+ -- or function call.
elsif Nkind (Parent (Par)) = N_Selected_Component then
declare
@@ -7306,9 +7307,19 @@ package body Sem_Ch4 is
begin
if Present (Nam)
and then Is_Overloadable (Nam)
- and then Present (First_Formal (Nam))
then
- return Ekind (First_Formal (Nam)) = E_In_Parameter;
+ if Nkind (Parent (Parent (Par)))
+ = N_Procedure_Call_Statement
+ then
+ return False;
+
+ else
+ if Ekind (Nam) = E_Function
+ and then Present (First_Formal (Nam))
+ then
+ return Ekind (First_Formal (Nam)) = E_In_Parameter;
+ end if;
+ end if;
end if;
end;