From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 42114385D0C4; Sat, 17 Dec 2022 20:00:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42114385D0C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671307227; bh=RLogNXdKd+S+BKCCOgj3XRc8ItjhJi6HVnfHKq2H+DY=; h=From:To:Subject:Date:From; b=v+sHK0x0axmVPOxm9YMttBedKcLTeevz26kns13wmBSmLHVh1r2yvf6WZjutCpPCU E+WmMNc9UUeUqfZoRzaXD43DPq12KeLSWtY1ztGz8/TNQaZY7T1XpxGF/TEdv+zmns vzLHvbI6eQvfxJBMSw3wlmP57BxJ2/Rd8ZR4XO/g= From: "simon at pushface dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/108157] New: [12/13 regression] object subtype doesn't statically match designated subtype Date: Sat, 17 Dec 2022 20:00:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon at pushface dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108157 Bug ID: 108157 Summary: [12/13 regression] object subtype doesn't statically match designated subtype Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: simon at pushface dot org CC: dkm at gcc dot gnu.org Target Milestone: --- Created attachment 54118 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54118&action=3Dedit Demonstrator The attached code fails with $ /opt/gcc-12.2.0/bin/gcc -c g-socser.adb g-socser.adb:13:22: error: object subtype must statically match designat= ed subtype The relevant part of g-socser.adb: 9. Connect_Socket 10. (Socket =3D> Client.Socket, 11. Server =3D> Client.Client_Address, 12. Timeout =3D> 0.0, 13. Selector =3D> Listener.Selector'Unchecked_Access, | >>> error: object subtype must statically match designated subtype The relevant part of g-socser.ads: 20. type Connections_Server is tagged limited record 21. -- limited because Selector_Type is limited 22. Selector : aliased Selector_Type; 23. end record; The relevant part of the GNAT standard library GNAT.Sockets is procedure Connect_Socket (Socket : Socket_Type; Server : Sock_Addr_Type; Timeout : Selector_Duration; Selector : access Selector_Type :=3D null; Status : out Selector_Status); and it=E2=80=99s the same Selector_Type all the way. I=E2=80=99ve looked at Annotated Ada Reference Manual (Ada 2022 Draft 34) 4= .9.1[1] and I can=E2=80=99t see what the problem is. Note, I don=E2=80=99t know why the code uses 'Unchecked_Access; 'Access giv= es the same error, 'Unrestricted_Access compiles OK. [1] http://www.ada-auth.org/standards/22aarm/html/AA-4-9-1.html=