https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113351
Bug ID: 113351
Summary: Primitive renaming, error: too many arguments in call.
Product: gcc
Version: 13.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: p.p11 at orange dot fr
CC: dkm at gcc dot gnu.org
Target Milestone: ---
Created attachment 57050
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57050&action=edit
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