https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123817
Bug ID: 123817
Summary: -gnatwk does not flag special 'Unused' variable
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: jesper.quorning at gmail dot com
CC: dkm at gcc dot gnu.org
Target Milestone: ---
The special variables 'Unused' etc are not flagged as could be constant.
```Ada
with Ada.Text_IO; use Ada.Text_IO;
procedure Constant_Unused
is
Unused : Natural := 42;
Used : Natural := 42;
begin
Put_Line (Used'Image);
end Constant_Unused;
```
Build with:
$ gnatmake -gnatwa constant_unused.adb
Does not flag Unused as could be declared constant.
Thanks