public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] ada: Fix limited_with in Check_Scil; allow for <> in pp of aggregate
@ 2024-01-09 13:15 Marc Poulhiès
  0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2024-01-09 13:15 UTC (permalink / raw)
  To: gcc-patches; +Cc: Tucker Taft

From: Tucker Taft <taft@adacore.com>

Check_Scil failed due to not handling a type that came from a package that was
mentioned in a limited-with clause.  Also, an aggregate with an uninitialized
component was not being pretty-printed properly.

gcc/ada/

	* pprint.adb (List_Name): Check for "Box_Present" when displaying
	a list, and emit "<>" if returns True.
	* sem_scil.adb (Check_SCIL_Node): Handle case when the type of a
	parameter is from a package that was mentioned in a limited with
	clause, and make no further checks, since this check routine does
	not have all the logic to check such a usage.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/pprint.adb   | 6 +++++-
 gcc/ada/sem_scil.adb | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/pprint.adb b/gcc/ada/pprint.adb
index 3843ec203b0..2a8f2f653f7 100644
--- a/gcc/ada/pprint.adb
+++ b/gcc/ada/pprint.adb
@@ -130,7 +130,11 @@ package body Pprint is
                   end loop;
                end;
                Append (Buf, " => ");
-               Append (Buf, Expr_Name (Expression (Elmt)));
+               if Box_Present (Elmt) then
+                  Append (Buf, "<>");
+               else
+                  Append (Buf, Expr_Name (Expression (Elmt)));
+               end if;
 
             --  Print parameter_association as "x => 12345"
 
diff --git a/gcc/ada/sem_scil.adb b/gcc/ada/sem_scil.adb
index d7679d8b50f..d720386c6af 100644
--- a/gcc/ada/sem_scil.adb
+++ b/gcc/ada/sem_scil.adb
@@ -98,6 +98,7 @@ package body Sem_SCIL is
                --  Interface types are unsupported.
 
                if Is_Interface (Ctrl_Typ)
+                 or else From_Limited_With (Ctrl_Typ)
                  or else Is_RTE (Ctrl_Typ, RE_Interface_Tag)
                  or else (Is_Access_Type (Ctrl_Typ)
                            and then
-- 
2.43.0


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

only message in thread, other threads:[~2024-01-09 13:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 13:15 [COMMITTED] ada: Fix limited_with in Check_Scil; allow for <> in pp of aggregate 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).