public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/113862] New: error: "others" choice not allowed here
@ 2024-02-10 10:18 p.p11 at orange dot fr
  2024-02-14 17:44 ` [Bug ada/113862] " ebotcazou at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: p.p11 at orange dot fr @ 2024-02-10 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113862
           Summary: error: "others" choice not allowed here
           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 57376
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57376&action=edit
Reproducer.

$ gcc -c -gnatl test34b.adb
GNAT 13.2.0
Compiling: test34b.adb
     1. procedure Test34b is
     2.
     3.    type NTCT is new Natural;
     4.    TBD_Error, Not_Valid_Error : exception;
     5.    function Is_Valid (P : NTCT) return Boolean is (False);
     6.    Param : NTCT;
     7.    type Some_Tagged is tagged null record;
     8.    type A_Tagged is new Some_Tagged with  record Comp : Character; end
record;
     9.    type Some_Array is array (Positive range <>) of NTCT;
    10.    function Func (Val : Integer) return Natural is (0);
    11.
    12.    --    Section_11_3_Paragraph_2a
    13.    Pre : Boolean  := (if not Is_Valid(Param) then raise
Not_Valid_Error);
    14.    A : A_Tagged   := (Some_Tagged'(raise TBD_Error) with Comp => 'A');
    15.    B : Some_Array := (1, 2, 3, others => raise Not_Valid_Error);
                                       |
        >>> error: "others" choice not allowed here
        >>> error: qualify the aggregate with a constrained subtype to provide
bounds for it

    16.    C : Natural    := Func (Val => raise TBD_Error);
    17.    D : A_Tagged   := ((raise TBD_Error) with Comp => 'A');
    18.
    19. begin
    20.    null;
    21. end;

It is weird as this code comes from AARM 2022 Section_11_3_Paragraph_2a.
See full source code in attachement.

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

end of thread, other threads:[~2024-02-25 10:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-10 10:18 [Bug ada/113862] New: error: "others" choice not allowed here p.p11 at orange dot fr
2024-02-14 17:44 ` [Bug ada/113862] " ebotcazou at gcc dot gnu.org
2024-02-14 17:46 ` ebotcazou at gcc dot gnu.org
2024-02-17 18:22 ` p.p11 at orange dot fr
2024-02-17 22:47 ` ebotcazou at gcc dot gnu.org
2024-02-19 10:56 ` charlet at gcc dot gnu.org
2024-02-25 10:42 ` p.p11 at orange dot fr

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).