diff options
author | Yannick Moy <moy@adacore.com> | 2020-09-15 15:28:51 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-10-26 04:59:06 -0400 |
commit | 326c36ce378edd0d965bb6dfd3d98a90668fff30 (patch) | |
tree | 65606feacf9f17cd7f41ebd31a85610cd857c974 /gcc | |
parent | 7649892bfc838aeb0723200b56f34bebe2a87b46 (diff) | |
download | gcc-326c36ce378edd0d965bb6dfd3d98a90668fff30.zip gcc-326c36ce378edd0d965bb6dfd3d98a90668fff30.tar.gz gcc-326c36ce378edd0d965bb6dfd3d98a90668fff30.tar.bz2 |
[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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 6937153..af77263 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 |