[Bug ada/126448] New: -gnatwu emits warning about use clause has no effect

"jesper.quorning at gmail dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126448

            Bug ID: 126448
           Summary: -gnatwu emits warning about use clause has no effect
           Product: gcc
           Version: 16.1.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: ---

This program:

```Ada
with Ada.Strings.Fixed;
with Ada.Text_IO;

procedure Program is
   use Ada;
   use Strings;
   use Fixed;

   function T (Item : String; Side : Trim_End) return String
     renames Trim;
begin
   Ada.Text_IO.Put_Line (T (" Hello ", Left));
end Program;
```

Building:
$ gnatmake -gnatwu program.adb 
gcc -c -gnatwu program.adb
program.adb:7:04: warning: use clause for package "Fixed" has no effect
[-gnatwu]
gnatbind -x program.ali
gnatlink program.ali

Expected no warning.

The problem is boiled down from a program not earlier build with -gnatwa.


Thanks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.