diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-03-05 13:03:18 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-05-17 10:21:00 +0200 |
commit | 4b5eeb74a20028e493b520887cc9fd97d6fc0f3d (patch) | |
tree | 43889edd329cd7f8e1998640644c709ac16ba05a /gcc/ada | |
parent | b87148fa43dfa2d8324cac4625a2b41ffda6bac9 (diff) | |
download | gcc-4b5eeb74a20028e493b520887cc9fd97d6fc0f3d.zip gcc-4b5eeb74a20028e493b520887cc9fd97d6fc0f3d.tar.gz gcc-4b5eeb74a20028e493b520887cc9fd97d6fc0f3d.tar.bz2 |
ada: Allow private items with unknown discriminants as Depends inputs
Objects of private types with unknown discriminants are now allowed as
inputs in the Depends contracts.
gcc/ada/
* sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Allow objects
of private types with unknown discriminants.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/sem_prag.adb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 9dc22e3..0302cdb 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -283,7 +283,8 @@ package body Sem_Prag is function Is_Unconstrained_Or_Tagged_Item (Item : Entity_Id) return Boolean; -- Subsidiary to Collect_Subprogram_Inputs_Outputs and the analysis of -- pragma Depends. Determine whether the type of dependency item Item is - -- tagged, unconstrained array or unconstrained record. + -- tagged, unconstrained array, unconstrained private or unconstrained + -- record. procedure Record_Possible_Body_Reference (State_Id : Entity_Id; @@ -32977,7 +32978,8 @@ package body Sem_Prag is return Has_Discriminants (Typ) and then not Is_Constrained (Typ); elsif Is_Private_Type (Typ) then - return Has_Discriminants (Typ); + return Has_Discriminants (Typ) + or else Has_Unknown_Discriminants (Typ); else return False; |