]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix Unchecked_Conversion in edge case
authorRonan Desplanques <desplanques@adacore.com>
Mon, 2 Jan 2023 15:38:36 +0000 (16:38 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 15 May 2023 09:36:40 +0000 (11:36 +0200)
commitbc60b3c350885cf60547f9e7002248b9bbb81e3d
tree0441ac46bd9b71389cfd9d778122698f56781b43
parentf04dae641112509bfd4ec8bd76774ebedca28d1f
ada: Fix Unchecked_Conversion in edge case

Before this patch, Set_Can_Use_Internal_Rep was called on access
to subprogram subtypes when instantiating Unchecked_Conversion
from System.Address to an access to subprogram subtype (or the
reverse). This was incorrect and caused an assertion failure.

This patch fixes that by modifying the Can_Use_Internal_Rep
attribute of the base type of the subtype instead.

gcc/ada/

* sem_ch13.adb (Validate_Unchecked_Conversion): Fix behavior on
System.Address to access to subprogram subtype conversion.
gcc/ada/sem_ch13.adb