[Bug ada/126482] New: Weird error messages with Unrestricted_Access.

"p.p11 at orange dot fr via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126482

            Bug ID: 126482
           Summary: Weird error messages with Unrestricted_Access.
           Product: gcc
           Version: 16.1.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 65167
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65167&action=edit
Reproducer.

Actual behavior:
(Full source files in attached archive)
% gcc -c -gnatfl multiuser.adb
GNAT 16.1.0
...
     3. with Gnoga.Gui.Base;
     4. with Gnoga.Gui.Element;
     5. with Gnoga.Types;
     6.
     7. procedure Multiuser is
...
    11.    use Gnoga.Gui.Element;
...
    19.    procedure On_Destroy (Object : in out
Gnoga.Gui.Base.Base_Type'Class)
    20.    is
    21.    begin
    22.       Log ("Winwdow is destroyed, Connection_Data");
    23.    end On_Destroy;
    24.
    25.    procedure On_Connect
    26.      (Main_Window : in out Gnoga.Gui.Window.Window_Type'Class;
    27.       Connection  : access
    28.         Gnoga.Application.Multi_Connect.Connection_Holder_Type);
    29.
    30.    procedure On_Connect
    31.      (Main_Window : in out Gnoga.Gui.Window.Window_Type'Class;
    32.       Connection  : access
    33.         Gnoga.Application.Multi_Connect.Connection_Holder_Type)
    34.    is
    35.       App : App_Access := new App_Data;
    36.    begin
    37.
    38.       App.Main_Window.On_Destroy_Handler
(On_Destroy'Unrestricted_Access);
                                                  1         5
        >>> error: no candidate interpretations match the actuals:
        >>> error: missing argument for parameter "Object" in call to
"On_Destroy" declared at line 19
        >>> error: missing argument for parameter "Object" in call to
"On_Destroy" (inherited) at gnoga-gui-element.ads:51
        >>> error: context requires function call, found procedure name
        >>> error: expected type "Action_Event" defined at
gnoga-gui-base.ads:290
        >>> error: found type access to type derived from "Standard._Void_Type"
defined at line 38
        >>> error:   ==> in call to inherited operation "On_Destroy_Handler" at
gnoga-gui-window.ads:56

    39.
    40.    end On_Connect;

Although On_Destroy is visible from both multiuser.adb:19 and
gnoga-gui-element.ads:51 (inherited from gnoga-gui-base.adb:622), the error
messages are weird.

Expected behavior:
Indicating whether there is no multi-visibility case or else issue a meaningful
error message.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.