The current termination condition of the recursion is wrong. When in
JSON mode, names should be fully qualified. This requires to stop not at
the first encountered compilation unit but to recurse up to Standard.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* repinfo.adb (List_Name): Rework termination condition.
diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
--- a/gcc/ada/repinfo.adb
+++ b/gcc/ada/repinfo.adb
@@ -44,6 +44,7 @@ with Sinfo.Nodes; use Sinfo.Nodes;
with Sinfo.Utils; use Sinfo.Utils;
with Sinput; use Sinput;
with Snames; use Snames;
+with Stand; use Stand;
with Stringt; use Stringt;
with Table;
with Ttypes;
@@ -874,10 +875,11 @@ package body Repinfo is
C : Character;
begin
- -- List the qualified name recursively, except
- -- at compilation unit level in default mode.
+ -- In JSON mode, we recurse up to Standard. This is also valid in
+ -- default mode where we recurse up to the first compilation unit and
+ -- should not get to Standard.
- if Is_Compilation_Unit (Ent) then
+ if Scope (Ent) = Standard_Standard then
null;
elsif not Is_Compilation_Unit (Scope (Ent))
or else List_Representation_Info_To_JSON