[Ada] Compiler failure on an extended_return_statement in a block
When compiling with an assertion-enabled compiler, Assert_Failure can be
raised when expanded an extended_return_statement whose enclosing scope
is not a function (such as when it's a block_statement). The simple fix
is to change the Assert to test Current_Subprogram rather than Current_Scope.
Three such Assert pragmas are corrected in this way.
2018-07-31 Gary Dismukes <dismukes@adacore.com>
gcc/ada/
* exp_ch6.adb (Expand_N_Extended_Return_Statement): Replace
calls to Current_Scope in three assertions with calls to
Current_Subprogram.
gcc/testsuite/
* gnat.dg/block_ext_return_assert_failure.adb: New testcase.
From-SVN: r263096