[Ada] Spurious error on discriminant of incomplete type
authorHristian Kirtchev <kirtchev@adacore.com>
Wed, 10 Jul 2019 09:02:31 +0000 (09:02 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 10 Jul 2019 09:02:31 +0000 (09:02 +0000)
commitd036b2b8c29f8d53787417a1c0b0ddf814ab8b6b
tree87ae56b2250db88d653229ef552fee9af1050112
parent6056bc735d81633bdefe3b696c917d3e4ea20049
[Ada] Spurious error on discriminant of incomplete type

This patch corrects the conformance verification of discriminants to
provide symmetry between the analysis of incomplete and full view
discriminants. As a result, types of discriminants always resolve to the
proper view.

2019-07-10  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* sem_ch6.adb (Check_Discriminant_Conformance): Use Find_Type to
discover the type of a full view discriminant.

gcc/testsuite/

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

From-SVN: r273347
gcc/ada/ChangeLog
gcc/ada/sem_ch6.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/incomplete7.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/incomplete7.ads [new file with mode: 0644]