aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2020-08-20 19:14:43 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-22 08:11:24 -0400
commit84d7433afffe536bac912082e076d257a0173a1e (patch)
tree771decc5bed9e60b38f2dbe58809991ee3d3f779 /gcc/ada
parent29f2d76c65e175e18305b92f56be40c2266e9c78 (diff)
downloadgcc-84d7433afffe536bac912082e076d257a0173a1e.zip
gcc-84d7433afffe536bac912082e076d257a0173a1e.tar.gz
gcc-84d7433afffe536bac912082e076d257a0173a1e.tar.bz2
[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".
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/einfo.adb2
-rw-r--r--gcc/ada/sem_res.adb6
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index 63878e4..d4a4310e 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 3084012b..3a3c93d 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;