[Ada] Fix compiler abort on invalid discriminant constraint
authorPatrick Bernardi <bernardi@adacore.com>
Tue, 22 May 2018 13:26:05 +0000 (13:26 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 22 May 2018 13:26:05 +0000 (13:26 +0000)
commit59ec5d9be29535f41ecd7840fcb11708edd584f3
tree35b97b87ce56b9febd379836338036e6b1954e5f
parent801b4022e11b50c4124b489ccc621332b2d92946
[Ada] Fix compiler abort on invalid discriminant constraint

This patch fixes a compiler abort on a discriminant constraint when the
constraint is a subtype indication.

2018-05-22  Patrick Bernardi  <bernardi@adacore.com>

gcc/ada/

* sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the
user tries to use a subtype indication as a discriminant constraint.

gcc/testsuite/

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

From-SVN: r260525
gcc/ada/ChangeLog
gcc/ada/sem_ch3.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/discr50.adb [new file with mode: 0644]