[Ada] Crash on named actual in postcondition for generic subprogram
authorEd Schonberg <schonberg@adacore.com>
Mon, 8 Jul 2019 08:13:04 +0000 (08:13 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 8 Jul 2019 08:13:04 +0000 (08:13 +0000)
commit5291985c00302036cc6d5932fdffb9acab3043cf
tree5a8235daf9a8a352f258c29c49aa04a99448cb63
parentb91cdf756caafddf48433e6f93c4cc0049d292f8
[Ada] Crash on named actual in postcondition for generic subprogram

This patch fixes a crash on compiling the postcondtion for a generic
subprogram, when the postcondition is a call with both positional and
named parameter associations.

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

gcc/ada/

* sem_ch13.adb (Analyze_Aspect_Specifications): For a
pre/postcondition of a generic subprogram declaration, do not
use Relocate_Node on the aspect expression to construct the
corresponding attribute specification, to prevent tree anomalies
when the expression is a call with named actual parameters.

gcc/testsuite/

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

From-SVN: r273201
gcc/ada/ChangeLog
gcc/ada/sem_ch13.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/predicate9.adb [new file with mode: 0644]