[Ada] Implement AI12-0036 (a new legality check for instantiations)

Pierre-Marie de Rodat derodat@adacore.com
Thu Dec 12 10:04:00 GMT 2019


AI12-0036 is a binding interpretation which adds the following legality
rule:

   The actual type for a formal derived type shall be tagged if and only
   if the formal derived type is a private extension.

Implement this new compile-time check. The check is implemented without
checking the value of Ada_Version because the AI is a binding
intepretation, and because the possible consequences of failing to
detect a violation may be severe.

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

2019-12-12  Steve Baird  <baird@adacore.com>

gcc/ada/

	* sem_ch12.adb
	(Instantiate_Type.Validate_Derived_Type_Instance): Implement the
	legality check of AI12-0036
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1456 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191212/2156ec85/attachment.bin>


More information about the Gcc-patches mailing list