]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix limited_with in Check_Scil; allow for <> in pp of aggregate
authorTucker Taft <taft@adacore.com>
Tue, 12 Dec 2023 20:28:37 +0000 (20:28 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 9 Jan 2024 13:13:31 +0000 (14:13 +0100)
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.

gcc/ada/pprint.adb
gcc/ada/sem_scil.adb

index 3843ec203b0dcc8dd23f96dba3306200f9bbaa7f..2a8f2f653f7dfca4bf781178390c9899070835eb 100644 (file)
@@ -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"
 
index d7679d8b50f99313551af910534af1c76bfe088d..d720386c6af78106cc45a9812fb7c1757f6cb712 100644 (file)
@@ -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