[Ada] Spurious error in discriminated aggregate
authorBob Duff <duff@adacore.com>
Wed, 14 Aug 2019 09:51:43 +0000 (09:51 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 14 Aug 2019 09:51:43 +0000 (09:51 +0000)
commitf056076f5fe77fe8b13050eb3affc4c8ac700722
treecfb611395dd402c4b53b85d431cb642a3aea0e39
parent2a127979d92caafe31a2c9be5d9f5bb70e1f4d98
[Ada] Spurious error in discriminated aggregate

This patch fixes a bug in which a spurious error is given on an
aggregate of a type derived from a subtype with a constrained
discriminant.

2019-08-14  Bob Duff  <duff@adacore.com>

gcc/ada/

* exp_aggr.adb (Init_Hidden_Discriminants): Avoid processing the
wrong discriminant, which could be of the wrong type.

gcc/testsuite/

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

From-SVN: r274458
gcc/ada/ChangeLog
gcc/ada/exp_aggr.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/discr57.adb [new file with mode: 0644]