[Ada] Fix detection of access-to-variable types

Pierre-Marie de Rodat derodat@adacore.com
Tue Jun 15 10:20:52 GMT 2021

Routine Is_Access_Variable, which relied on the Ekind of the type,
wrongly returned True for subtypes of an access-to-subprogram type. It
is more reliable to also use Directly_Designated_Type.

This only affects SPARK legality checks for Global and Depends
contracts; compilation is not affected, because it doesn't rely on the
modified routine.

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


	* sem_prag.adb: Fix typos in comments related to access types.
	* sem_util.adb (Is_Access_Variable): Stronger condition.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1409 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210615/cdd54789/attachment.bin>

More information about the Gcc-patches mailing list