public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/113536] New: valid reduction expression rejected by -gnatVo
@ 2024-01-22  5:30 devotus at yahoo dot com
  2024-01-22 18:39 ` [Bug ada/113536] " devotus at yahoo dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: devotus at yahoo dot com @ 2024-01-22  5:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113536
           Summary: valid reduction expression rejected by -gnatVo
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: devotus at yahoo dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

The legal program below fails to compile when `-gnatVo` is active. The error
message is

    test_reduction.adb:13:15: error: missing argument for parameter
"Accumulator" in call to "Do_Something" declared at line 9

The error seems to date back at least to gnat 10.2.

pragma Ada_2022;

with Ada.Text_IO;

procedure Test_Reduction is

   subtype Value is Natural range 0 .. 255;

   function Do_Something (Accumulator : Value; Symbol : Character) return Value
   is (((Accumulator + Character'Pos (Symbol)) * 17) mod 256);

   function Do_It_By_Reduction (S : String) return Value is
   (S'Reduce (Do_Something, 0));

   Test_It : constant Value := Do_It_By_Reduction ("Hello, world!");

begin

   Ada.Text_IO.Put_Line (Test_It'Image);

end Test_Reduction;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-07  7:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22  5:30 [Bug ada/113536] New: valid reduction expression rejected by -gnatVo devotus at yahoo dot com
2024-01-22 18:39 ` [Bug ada/113536] " devotus at yahoo dot com
2024-02-03 12:03 ` [Bug ada/113536] [14 regression] valid reduction expression rejected ebotcazou at gcc dot gnu.org
2024-03-04 13:17 ` rguenth at gcc dot gnu.org
2024-05-07  7:44 ` [Bug ada/113536] [14/15 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).