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

            Bug ID: 113352
           Summary: error: invalid prefix in selected component with
                    overloaded subprogram.
           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 57051
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57051&action=edit
Reproducer.

Let's define:
   package Loggings is
      type Logging is tagged limited private;
      type Logging_Class is access all Logging'Class;
      function Handler return Logging_Class;
      procedure Handler (To : Logging_Class);
      procedure Log (Handler : Logging; Msg : String);
   private
...
   end Loggings;
and declare:
   procedure My_Log_4 (Msg : String) is
   begin
      Loggings.Handler.Log (Msg);
   end;

Result:
% gcc -gnatv -c 2024/test_20240110_func_prefix.adb   

GNAT 13.2.0
Copyright 1992-2023, Free Software Foundation, Inc.

Compiling: 2024/test_20240110_func_prefix.adb
Source file time stamp: 2024-01-12 11:17:13
Compiled at: 2024-01-12 12:17:34

    32.       Loggings.Handler.Log (Msg);
                              |
        >>> error: invalid prefix in selected component "Handler"

Expected result:
Function Handler should be selected instead of procedure Handler.

Reply via email to