[Ada] Spurious error on overriding protected function in instance
authorEd Schonberg <schonberg@adacore.com>
Tue, 21 Aug 2018 14:48:03 +0000 (14:48 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 21 Aug 2018 14:48:03 +0000 (14:48 +0000)
commit24241bd0388ec6f730788540b289da12c13a34cc
tree5be71cb8445185298b7e449e1402055a6380fb2e
parent5bb9ebcbc8270bcc08f955d196ad8c1bba003ec1
[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.

From-SVN: r263731
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]