Bug 113351 - error on primitive renaming: too many arguments in call
Summary: error on primitive renaming: too many arguments in call
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 13.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-12 10:40 UTC by Pascal Pignard
Modified: 2024-01-20 09:34 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-01-19 00:00:00


Attachments
Reproducer. (502 bytes, text/plain)
2024-01-12 10:40 UTC, Pascal Pignard
Details
Reproducer version 2. (444 bytes, text/plain)
2024-01-20 09:02 UTC, Pascal Pignard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Pignard 2024-01-12 10:40:55 UTC
Created attachment 57050 [details]
Reproducer.

Let's define:
   package Loggings is
      type Logging is tagged record
         Output : Ada.Text_IO.File_Access;
      end record;
      procedure Log (Handler : Logging; Msg : String);
      procedure Log (Handler : Logging; Msg : String; Err : Natural);
   end Loggings;
and declare:
   My_Handler         : aliased Loggings.Logging      := (Output => Ada.Text_IO.Current_Output);
   My_Generic_Handler : access Loggings.Logging'Class := My_Handler'Access;
   procedure My_Log_3 (Msg : String) renames My_Generic_Handler.Log;
   procedure My_Log_4 (Msg : String; Err : Natural) renames My_Generic_Handler.Log; -- error: too many arguments in call

Result with GNAT 13.2.0:
test_20240110_renproc.adb:48:14: error: too many arguments in call to "log"

Expected result:
No error for My_Log_4 renaming declaration as for My_Log_3.

Discussion on CLA:
https://groups.google.com/g/comp.lang.ada/c/wpjZmaqmLrk/m/of81pnmeAQAJ
Comment 1 Eric Botcazou 2024-01-19 11:34:08 UTC
Same errors as the other:

test_20240110_renproc.adb:31:24: error: no selector "Put_Line" for private type "Ada.Text_Io.File_Type"
test_20240110_renproc.adb:35:24: error: no selector "Put_Line" for private type "Ada.Text_Io.File_Type"
test_20240110_renproc.adb:40:24: error: no selector "Put_Line" for private type "Ada.Text_Io.File_Type"
Comment 2 Pascal Pignard 2024-01-20 09:02:24 UTC
Created attachment 57173 [details]
Reproducer version 2.

Actually, the special -gnatX is needed.
I was experimenting some new features from AdaCore.
Any way, nothing related with the issue, thus, I post a version 2:
(Note: one change from reproducer of Bug 113350 -> uncomment line 36.)

% gnatmake test_20240110_renproc_2.adb
gcc -c test_20240110_renproc_2.adb
test_20240110_renproc_2.adb:36:14: error: too many arguments in call to "log"
Comment 3 Eric Botcazou 2024-01-20 09:34:29 UTC
Thanks for the adjustment.  Another very peculiar issue.