public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-596] ada: Only record types with discriminants can be unconstrained
@ 2024-05-17 8:25 Marc Poulhi?s
0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2024-05-17 8:25 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:376a8ea17dfb3dc1267dc88bd90e5f84b82aadaa
commit r15-596-g376a8ea17dfb3dc1267dc88bd90e5f84b82aadaa
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Tue Mar 5 14:42:08 2024 +0100
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.
Diff:
---
gcc/ada/sem_prag.adb | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index e57f42d9a54d..02aad4d1caa2 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-17 8:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-17 8:25 [gcc r15-596] ada: Only record types with discriminants can be unconstrained Marc Poulhi?s
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).