This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r263726 - in /trunk/gcc: ada/ChangeLog ada/sem_...


Author: pmderodat
Date: Tue Aug 21 14:47:32 2018
New Revision: 263726

URL: https://gcc.gnu.org/viewcvs?rev=263726&root=gcc&view=rev
Log:
[Ada] Spurious ambiguity error on call returning an access type

If F is a function with a single defaulted parameter that returns an
access_to_array type, then F (I) may designate either the return type or
an indexing of the result of the call, after implicit dereferencing.  If
the component type C of the array type AR is accces AR this is ambiguous
in a context whose expected type is C. If F is parameterless the call is
not ambiguous.

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

gcc/ada/

	* sem_res.adb (Resolve_Call): Resolve correctly a parameterless
	call that returns an access type whose designated type is the
	component type of an array, when the function has no defaulted
	parameters.

gcc/testsuite/

	* gnat.dg/access5.adb, gnat.dg/access5.ads: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/access5.adb
    trunk/gcc/testsuite/gnat.dg/access5.ads
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_res.adb
    trunk/gcc/testsuite/ChangeLog


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]