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

            Bug ID: 113868
           Summary: error: expression function must be enclosed in
                    parentheses.
           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 57383
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57383&action=edit
Reproducer.

$ gcc -c -gnat2022 -gnatl 2020/test_20200521_expr.adb 
GNAT 13.2.0
     1. procedure Test_20200521_expr is
     2.
     3.    type Real is digits 8;
     4.    type Point is tagged record
     5.       X, Y : Real := 0.0;
     6.    end record;
     7.
     8.    --    Section_4.3.4_Paragraph_30
     9.    function Translate (P : Point'Class; X, Y : Real) return Point'Class
is
    10.      (P with delta X => P.X + X,
             |
        >>> error: expression function must be enclosed in parentheses

    11.       Y => P.Y + Y);
    12.
    13. begin
    14.    null;
    15. end;

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

Reply via email to