diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-03-05 14:42:08 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-05-17 10:21:00 +0200 |
commit | 376a8ea17dfb3dc1267dc88bd90e5f84b82aadaa (patch) | |
tree | 18a1e7c313465a5d917557944ff3606f28dad70c /gcc/ada | |
parent | 8e4069566e5ce4f2d936635187fd90c300e475e9 (diff) | |
download | gcc-376a8ea17dfb3dc1267dc88bd90e5f84b82aadaa.zip gcc-376a8ea17dfb3dc1267dc88bd90e5f84b82aadaa.tar.gz gcc-376a8ea17dfb3dc1267dc88bd90e5f84b82aadaa.tar.bz2 |
ada: Only record types with discriminants can be unconstrained
Remove redundant condition for detecting unconstrained record types.
Code cleanup; behavior is unaffected.
gcc/ada/
* sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Remove call
to Has_Discriminants; combine ELSIF branches.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/sem_prag.adb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index e57f42d..02aad4d 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -32971,13 +32971,10 @@ package body Sem_Prag is if Is_Tagged_Type (Typ) then return True; - elsif Is_Array_Type (Typ) then - return not Is_Constrained (Typ); - - elsif Is_Record_Type (Typ) then - return Has_Discriminants (Typ) and then not Is_Constrained (Typ); - - elsif Is_Private_Type (Typ) then + elsif Is_Array_Type (Typ) + or else Is_Record_Type (Typ) + or else Is_Private_Type (Typ) + then return not Is_Constrained (Typ); else |