[Ada] Spurious error on indexed call as prefix of a call
authorEd Schonberg <schonberg@adacore.com>
Mon, 21 May 2018 14:51:35 +0000 (14:51 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 21 May 2018 14:51:35 +0000 (14:51 +0000)
commit123906261b40f9084205961dcced31799c322083
treee13fe3c67622d8f6bd4332798188fd79816179e3
parenta2fcf1e02c7809a14e2bde3a26fec86b4cbd9ab3
[Ada] Spurious error on indexed call as prefix of a call

This patch refines the handling of the well-known syntactic ambiguity created
by a function with defaulted parameters that returns an array, so that F (X)
may designate a call to the function, or an indexing of a parameterless call.
This patch handles the case where such a call is itself the prefix of another
call, and the function is a primitive operation invoked in prefix form.

2018-05-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch4.adb (Analyze_One_Call): Recognize complex cases where an
indexed call originally in prefix forn is itself the prefix of a
further call.

gcc/testsuite/

* gnat.dg/array30.adb: New testcase.

From-SVN: r260461
gcc/ada/ChangeLog
gcc/ada/sem_ch4.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/array30.adb [new file with mode: 0644]