From: Yannick Moy Date: Tue, 15 Sep 2020 13:28:51 +0000 (+0200) Subject: [Ada] Fix GNATprove crash on generics with access types X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=326c36ce378edd0d965bb6dfd3d98a90668fff30;p=gcc.git [Ada] Fix GNATprove crash on generics with access types gcc/ada/ * sem_ch12.adb (Restore_Private_Views): Do not lose the information provided by Is_Generic_Actual_Type in GNATprove mode. --- diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 6937153c537..af77263388c 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -15389,13 +15389,21 @@ package body Sem_Ch12 is if Is_Type (E) and then Nkind (Parent (E)) = N_Subtype_Declaration then + -- Always preserve the flag Is_Generic_Actual_Type for GNATprove, + -- as it is needed to identify the subtype with the type it + -- renames, when there are conversions between access types + -- to these. + + if GNATprove_Mode then + null; + -- If the actual for E is itself a generic actual type from -- an enclosing instance, E is still a generic actual type -- outside of the current instance. This matter when resolving -- an overloaded call that may be ambiguous in the enclosing -- instance, when two of its actuals coincide. - if Is_Entity_Name (Subtype_Indication (Parent (E))) + elsif Is_Entity_Name (Subtype_Indication (Parent (E))) and then Is_Generic_Actual_Type (Entity (Subtype_Indication (Parent (E)))) then