diff options
author | Tucker Taft <taft@adacore.com> | 2023-12-12 20:28:37 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-01-09 14:13:31 +0100 |
commit | 1e964635b64a8e65492751082b39c677f95f39e3 (patch) | |
tree | 1eaa2f4be3dd91d39df26e44ead1586e655c2627 | |
parent | fc48e3b206039b4bc7e636f13a8f65d80d93b2d4 (diff) | |
download | gcc-1e964635b64a8e65492751082b39c677f95f39e3.zip gcc-1e964635b64a8e65492751082b39c677f95f39e3.tar.gz gcc-1e964635b64a8e65492751082b39c677f95f39e3.tar.bz2 |
ada: Fix limited_with in Check_Scil; allow for <> in pp of aggregate
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.
-rw-r--r-- | gcc/ada/pprint.adb | 6 | ||||
-rw-r--r-- | gcc/ada/sem_scil.adb | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/pprint.adb b/gcc/ada/pprint.adb index 3843ec2..2a8f2f6 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 d7679d8..d720386 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 |