[Ada] Spurious error on overriding protected function in instance
commitfec1e5e70836056f2a602537232c2908da56ed41
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 14:48:03 +0000 (21 14:48 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 14:48:03 +0000 (21 14:48 +0000)
tree5be71cb8445185298b7e449e1402055a6380fb2e
parent86af16cb60897b743fe264a29dbb953be7a570dd
[Ada] Spurious error on overriding protected function in instance

The conformance between an overriding protected operation with
progenitors and the overridden interface operation requires subtype
conformance; requiring equality of return types in the case of a
function is too restrictive and leads to spurious errors when the return
type is a generic actual.

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

gcc/ada/

* sem_ch6.adb (Check_Synchronized_Overriding): The conformance
between an overriding protected operation and the overridden
abstract progenitor operation requires subtype conformance;
requiring equality of return types in the case of a function is
too restrictive and leads to spurious errors when the return
type is a generic actual.

gcc/testsuite/

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263731 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/sem_ch6.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/prot6.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/prot6.ads [new file with mode: 0644]