[Ada] Fix run-time segfault with derived access-to-subprogram type
This fixes a segfault at run time for the call to a local subprogram
through an access value if the type of this access value is derived
from an initial access-to-subprogram type and the access value was
originally obtained with the initial type.
2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_ch3.adb (Build_Derived_Access_Type): If this is an access-
to-subprogram type, copy Can_Use_Internal_Rep from the parent.
gcc/testsuite/
* gnat.dg/access9.adb: New testcase.
From-SVN: r275945