public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/113350] New: Class wide renaming primitive.
@ 2024-01-12 10:22 p.p11 at orange dot fr
  2024-01-19 11:31 ` [Bug ada/113350] class-wide " ebotcazou at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: p.p11 at orange dot fr @ 2024-01-12 10:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113350
           Summary: Class wide renaming primitive.
           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 57049
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57049&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);
      type Full_Logging is new Logging with null record;
      procedure Log (Handler : Full_Logging; Msg : String);
   end Loggings;
and declare:
   My_Handler         : aliased Loggings.Logging      := (Output =>
Ada.Text_IO.Current_Output);
   My_Full_Handler : aliased Loggings.Full_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;
and code:
   My_Log_3 ("Hei");
   My_Generic_Handler := My_Full_Handler'Access;
   My_Log_3 ("Hei");
and result with GNAT 13.2.0:
Hei
Full Hei

Expected result:
Hei
Hei

Discussion from Randy on CLA
(https://groups.google.com/g/comp.lang.ada/c/wpjZmaqmLrk):
The "name" is evaluated during a renaming, and the renamed entity does not
change afterwards. So whatever subprogram My_Log_3 designates for the first
call should be the same for the second call.

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

* [Bug ada/113350] class-wide renaming primitive
  2024-01-12 10:22 [Bug ada/113350] New: Class wide renaming primitive p.p11 at orange dot fr
@ 2024-01-19 11:31 ` ebotcazou at gcc dot gnu.org
  2024-01-20  8:56 ` p.p11 at orange dot fr
  2024-01-20  9:31 ` ebotcazou at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-01-19 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
                 CC|                            |ebotcazou at gcc dot gnu.org
   Last reconfirmed|                            |2024-01-19
            Summary|Class wide renaming         |class-wide renaming
                   |primitive.                  |primitive

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
The reproducer does not compile:

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"

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

* [Bug ada/113350] class-wide renaming primitive
  2024-01-12 10:22 [Bug ada/113350] New: Class wide renaming primitive p.p11 at orange dot fr
  2024-01-19 11:31 ` [Bug ada/113350] class-wide " ebotcazou at gcc dot gnu.org
@ 2024-01-20  8:56 ` p.p11 at orange dot fr
  2024-01-20  9:31 ` ebotcazou at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: p.p11 at orange dot fr @ 2024-01-20  8:56 UTC (permalink / raw)
  To: gcc-bugs

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

Pascal Pignard <p.p11 at orange dot fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #57049|0                           |1
        is obsolete|                            |

--- Comment #2 from Pascal Pignard <p.p11 at orange dot fr> ---
Created attachment 57172
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57172&action=edit
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:

% gnatmake test_20240110_renproc_2.adb 
gcc -c test_20240110_renproc_2.adb
gnatbind -x test_20240110_renproc_2.ali
gnatlink test_20240110_renproc_2.ali

% ./test_20240110_renproc_2 
Hei
Full Hei

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

* [Bug ada/113350] class-wide renaming primitive
  2024-01-12 10:22 [Bug ada/113350] New: Class wide renaming primitive p.p11 at orange dot fr
  2024-01-19 11:31 ` [Bug ada/113350] class-wide " ebotcazou at gcc dot gnu.org
  2024-01-20  8:56 ` p.p11 at orange dot fr
@ 2024-01-20  9:31 ` ebotcazou at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2024-01-20  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Thanks for the adjustment.  Very peculiar issue in any case.

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

end of thread, other threads:[~2024-01-20  9:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-12 10:22 [Bug ada/113350] New: Class wide renaming primitive p.p11 at orange dot fr
2024-01-19 11:31 ` [Bug ada/113350] class-wide " ebotcazou at gcc dot gnu.org
2024-01-20  8:56 ` p.p11 at orange dot fr
2024-01-20  9:31 ` ebotcazou 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).