aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-03-05 14:42:08 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-17 10:21:00 +0200
commit376a8ea17dfb3dc1267dc88bd90e5f84b82aadaa (patch)
tree18a1e7c313465a5d917557944ff3606f28dad70c /gcc/ada
parent8e4069566e5ce4f2d936635187fd90c300e475e9 (diff)
downloadgcc-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.adb11
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