[Bug ada/126413] New: Error message issue for raise expression and with Atomic.

"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=126413

            Bug ID: 126413
           Summary: Error message issue for raise expression and with
                    Atomic.
           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 65132
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65132&action=edit
Reproducer.

Reproducer (source in attached file):
% gcc -c -gnatlf test34.adb
GNAT 16.1.0
     1. procedure Test34 is
     2.
     3.    type NTCT is new Natural;
     4.    function Func_Call return Boolean is (False);
     5.    TBD_Error, Not_Valid_Error : exception;
     6.    function Is_Valid (P : NTCT) return Boolean is (False);
     7.    Param : NTCT;
     8.    type Some_Tagged is tagged record
     9.       X : Integer;
    10.    end record;
    11.    type A_Tagged is new Some_Tagged with  record Comp : Character; end
record;
    12.    type Some_Array is array (Positive range 1 .. 10) of NTCT;
    13.    function Func (Val : Integer) return Natural is (0);
    14.
    15.    --    Section_11_3_Paragraph_2a
    16.    --  Obj1 : Boolean := Func_Call or else raise TBD_Error with Atomic;
-- illegal
    17.    Obj2 : Boolean := Func_Call or else (raise TBD_Error) with Atomic;
    18.    Obj3 : Boolean := (Func_Call or else raise TBD_Error) with Atomic;
    19.    Obj4 : Boolean := Func_Call or else (raise TBD_Error with Atomic);
                                                                     |
        >>> error: "Atomic" is undefined

    20.    Obj5 : Boolean := (Func_Call or else raise TBD_Error with Atomic);
                                                                     |
        >>> error: "Atomic" is undefined

    21.    Pre : Boolean  := (if not Is_Valid(Param) then raise
Not_Valid_Error);
    22.    A : A_Tagged   := (Some_Tagged'(raise TBD_Error) with Comp => 'A');
    23.    B : Some_Array := (1, 2, 3, others => raise Not_Valid_Error);
    24.    C : Natural    := Func (Val => raise TBD_Error);
    25.    D : A_Tagged   := ((raise TBD_Error) with Comp => 'A');
    26.
    27. begin
    28.    null;
    29. end;

According AARM 11.3 2.a.7/4, lines 19 and 20 are legal.
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.