From: Gary Dismukes Date: Thu, 20 Aug 2020 23:14:43 +0000 (-0400) Subject: [Ada] AI12-0095 Formal types and Constrained Partial Views X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84d7433afffe536bac912082e076d257a0173a1e;p=gcc.git [Ada] AI12-0095 Formal types and Constrained Partial Views gcc/ada/ * einfo.adb (Has_Constrained_Partial_View): Apply Base_Type to Id. * sem_res.adb (Resolve_Actuals.Check_Aliased_Parameter): Remove "not Is_Generic_Type" test and call Object_Type_Has_Constrained_Partial_View instead of Has_Constrained_Partial_View. Improve related error message to say "does not statically match" instead of just "does not match". --- diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 63878e4e1ed..d4a4310e364 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -1523,7 +1523,7 @@ package body Einfo is function Has_Constrained_Partial_View (Id : E) return B is begin pragma Assert (Is_Type (Id)); - return Flag187 (Id); + return Flag187 (Base_Type (Id)); end Has_Constrained_Partial_View; function Has_Controlled_Component (Id : E) return B is diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 3084012b444..3a3c93dd3c1 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -3479,13 +3479,13 @@ package body Sem_Res is elsif Has_Discriminants (F_Typ) and then not Is_Constrained (F_Typ) - and then not Has_Constrained_Partial_View (F_Typ) - and then not Is_Generic_Type (F_Typ) + and then not Object_Type_Has_Constrained_Partial_View + (Typ => F_Typ, Scop => Current_Scope) then null; else - Error_Msg_NE ("untagged actual does not match " + Error_Msg_NE ("untagged actual does not statically match " & "aliased formal&", A, F); end if;