[Ada] Crash on named actual in postcondition for generic subprogram

Pierre-Marie de Rodat derodat@adacore.com
Mon Jul 8 08:19:00 GMT 2019


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.

Tested on x86_64-pc-linux-gnu, committed on trunk

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 2304 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190708/87be0879/attachment.bin>


More information about the Gcc-patches mailing list