https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89742

            Bug ID: 89742
           Summary: Ada2020 target assignment in generic renders a type
                    invisible
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nicolas at debian dot org
  Target Milestone: ---

Hello.
This issue affects the @ target assignement in Ada, which is not yet officially
released, but supported with the appropriate options.

This program is legal, but if the indicated Ref is replaced with @,
GCC reports an error.

cat > main.adb <<EOF
procedure Main is
   type Rec is record
      I : Integer;
   end record;
   type Acc is access Rec;
   generic
   procedure Generic_P;
   procedure Generic_P is
      Ref : Acc;
   begin
      Ref := new Rec'(I => Ref.all.I);
      --                   ^ this Ref.
   end Generic_P;
   procedure P is new Generic_P;
begin
   null;
end Main;
EOF

echo 'Produces sensible warnings.'
gnatgcc -c -gnat2020 main.adb

sed -i 's/=> Ref/=> @/' main.adb

echo 'Now says "Rec" is undefined.'
gnatgcc -c -gnat2020 main.adb

Reply via email to