[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".
This commit is contained in:
parent
29f2d76c65
commit
84d7433aff
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user