[Ada] Crash on return of raise expression
authorJustin Squirek <squirek@adacore.com>
Thu, 24 May 2018 13:05:32 +0000 (13:05 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 24 May 2018 13:05:32 +0000 (13:05 +0000)
commitc06a59be1990743d1520b89016a532572a9256ab
tree9737fecf2ea356b3edff25e5d218e47d3f7f82d1
parentfa3717c173192eb04440734a3ee110982f31e592
[Ada] Crash on return of raise expression

This patch fixes an issue whereby the compiler regarded assignments to limited
that consisted of raise expressions to be a compile-time error during
expansion.

2018-05-24  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* exp_ch3.adb (Expand_N_Object_Declaration): Ignore raising an error in
expansion for limited tagged types when the node to be expanded is a
raise expression due to it not representing a valid object.
* exp_ch5.adb (Expand_N_Assignment_Statement): Add exception to error
message regarding assignments to limited types to ignore genereated
code.

gcc/testsuite/

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

From-SVN: r260654
gcc/ada/ChangeLog
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch5.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/raise_expr.adb [new file with mode: 0644]