[Ada] Additional legality rule for indexing operation for derived type

Pierre-Marie de Rodat derodat@adacore.com
Wed Jun 17 08:16:11 GMT 2020


AI12-0160 clarifies the rules for nonoverridable aspects for indexing:
when a derived type inherits a single indexing aspect (constant or
variable) from a parent type, it cannot specify the other
(non-inherited) indexing aspect.

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

2020-06-17  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch13.adb: (Check_Inherited_Indexing): Check that a type
	derived from an indexable container type cannot specify an
	indexing aspect if the same aspect is not specified for the
	parent type (RM 4.1.6 (6/5), AI12-160). Add a check that a
	specified indexing aspect for a derived type is confirming.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 3310 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200617/b03e8bf2/attachment-0001.bin>


More information about the Gcc-patches mailing list