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

            Bug ID: 109472
           Summary: [13 regression] False unread/unassigned warning for
                    variable in local package
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at pushface dot org
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 54830
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54830&action=edit
Demonstrator

The compiler warns that a variable in a local package is not assigned and not
read, even though it is assigned and read in code outside the package.

GNAT 13.0.1 20230409 (experimental)
Copyright 1992-2023, Free Software Foundation, Inc.

Compiling: test_wu.adb
Source file time stamp: 2023-04-11 14:20:32
Compiled at: 2023-04-11 15:30:49

     1. procedure Test_Wu is
     2.
     3.   package P is
     4.     X : Integer;
            |
        >>> warning: variable "X" is never read and never assigned [-gnatwu]

     5.   end;
     6.
     7.   Y : Integer;
     8.
     9. begin
    10.   P.X := 5;
    11.   Y := P.X;
    12. end;

 12 lines: No errors, 1 warning

Reply via email to