https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117485
Bug ID: 117485
Summary: aspect "type_invariant" only allowed for private type
or corresponding full view, but RM doesn't mention
that
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: 00120260a at gmail dot com
CC: dkm at gcc dot gnu.org
Target Milestone: ---
The release version is gnat_native_14.2.1_06bb3def. this code below fails with
all the people that tried it:
procedure main is
type ArrayInput is array (Positive range <>) of Integer with Type_Invariant
=> (for all I in ArrayInput(1..ArrayInput'Last-1) => ArrayInput(I).K <
ArrayInput(I+1).K);
begin
null;
end main;
The error raised is "main.adb:4:10: error: aspect "type_invariant" only allowed
for private type or corresponding full view". The problem is that such
limitation is mentioned nowhere in the reference manual. In doubt, I'd tend to
think the RM is right and the developers wrong.