[Ada] Crash on object initialization that is call to expression function
authorEd Schonberg <schonberg@adacore.com>
Mon, 19 Aug 2019 08:37:18 +0000 (08:37 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 19 Aug 2019 08:37:18 +0000 (08:37 +0000)
commitfcef060c9b321edcb24a56616588e712c22029ba
treefa2ac7b8b70693305f9e74b04b5dac7f11a2c259
parentc70220382300ae326ad63fe54c5a32da202d1f13
[Ada] Crash on object initialization that is call to expression function

This patch fixes a compiler abort on an object declaration for a
class-wide type whose expression is a call to an expression function
that returns type extension.

2019-08-19  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Call): A call to an expression function
freezes when expander is active, unless the call appears within
the body of another expression function,

gcc/testsuite/

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

From-SVN: r274662
gcc/ada/ChangeLog
gcc/ada/sem_res.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/expr_func9.adb [new file with mode: 0644]