public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3778] ada: Reject record delta aggregates with limited expressions
@ 2022-11-08  8:40 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2022-11-08  8:40 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4a22fdac0f6e79478768e6792c9804816ecb3f4a

commit r13-3778-g4a22fdac0f6e79478768e6792c9804816ecb3f4a
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Thu Oct 14 12:48:12 2021 +0200

    ada: Reject record delta aggregates with limited expressions
    
    Implement a missing check related to record delta aggregates.
    
    gcc/ada/
    
            * sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reject
            expressions of a limited types.

Diff:
---
 gcc/ada/sem_aggr.adb | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 31ce9cadd94..383f18f7301 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -3746,7 +3746,17 @@ package body Sem_Aggr is
               ("'<'> in record delta aggregate is not allowed", Assoc);
          else
             Analyze_And_Resolve (Expression (Assoc), Comp_Type);
+
+            --  The expression must not be of a limited type; RM 4.3.1(17.4/5)
+
+            if Is_Limited_Type (Etype (Expression (Assoc))) then
+               Error_Msg_N
+                 ("expression of a limited type in record delta aggregate " &
+                    "is not allowed",
+                  Expression (Assoc));
+            end if;
          end if;
+
          Next (Assoc);
       end loop;
    end Resolve_Delta_Record_Aggregate;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-08  8:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08  8:40 [gcc r13-3778] ada: Reject record delta aggregates with limited expressions 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).