[Ada] Fix assertion failure on record subtype with -gnatRj
commit3558a9f4bd6752833802367cd702d3a21afe9fcf
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Sep 2018 09:17:05 +0000 (26 09:17 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Sep 2018 09:17:05 +0000 (26 09:17 +0000)
tree79af3198a79338d30d795c9898c973c38f3e8a9b
parent2ea1bab9fc28e57c8151f6cbd2edb46b1d2f2d5f
[Ada] Fix assertion failure on record subtype with -gnatRj

The JSON output of the -gnatR machinery was choking on record subtypes
and the change fixes this oversight.

The following package must now compile properly with -gnatRj:

package P is

  type Rec (D : Integer) is record
      C : Integer;

      case D is
         when 1 =>
            S : String (1 .. 20);
         when 2 =>
            B : Boolean;
         when others =>
            Ch1 : Character;
            F   : Float;
            Ch2 : Character;
      end case;

   end record;

   subtype Rec1 is Rec (1);

end P;

2018-09-26  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* repinfo.adb (List_Record_Layout): Be prepared for JSON output.
(List_Record_Info): Use the flat representation for record
subtypes in the JSON format.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264609 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/repinfo.adb