Ada.Containers.Vectors 不支持 GNAT GPL 2017

Ada.Containers.Vectors not working with GNAT GPL 2017

我正在尝试编译这段代码:

with Ada.Containers.Vectors;

procedure Test is
   type My_Type is range -1 .. Integer'Last;
   package My_Vectors is new Ada.Containers.Vectors (Positive, My_Type);
   Vector : My_Vectors.Vector;
begin
   Vector.Append (-1);
end Test;

gnatmake test.adb 给出此输出:

gcc -c test.adb
a-convec.adb:1553:33: missing operand
gnatmake: "test.adb" compilation error

错误消息导致在 stdlib 的实现中执行此过程:

   procedure Insert
     (Container : in out Vector;
      Before    : Extended_Index;
      Count     : Count_Type := 1)
   is
      New_Item : Element_Type := <>;  --  << here
      pragma Warnings (Off, New_Item);

   begin
      Insert (Container, Before, New_Item, Count);
   end Insert;

看起来不错。我不明白错误信息,这里有什么问题?是标准库中的错误吗?

Looks like this file has been tampered with…

总结证据,

  • 多个 报告 GNAT 版本可以追溯到 4.9.1。

  • 标记为 << here 的初始化是编译时错误,因为 compound delimiter <>, named box, is not valid in an expression used in assignment.

  • 基于How gnatmake Worksa-convec.adb只有修改对应的.ali文件后才会重新编译.

展望未来,您可能

  • 检查 a-convec.adba-convec.ali 的修改日期,分别在 adaincludeadalib 目录中找到。

  • 重新安装编译器。

  • 如果有必要通知上游维护者。