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

            Bug ID: 113412
           Summary: ATAN(Y,X) does not check arguments and generates wrong
                    error message.
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kargl at gcc dot gnu.org
  Target Milestone: ---

Fortran 2008 added the misguided form ATAN(Y,X) where Y could be missing.
However, if Y is present, then X is required to have the same type and
kind as Y.

Consider,

% cat a.f90
program main
   real(4) x
   real(8) y
   x = 1.
   y = x
   print*, atan(y,x), atan2(y,x)
end


% gfcx -o z a.f90
a.f90:6:10:

    6 |    print*, atan(y,x), atan2(y,x)
      |          1
Error: Too many arguments in call to ‘atan’ at (1)
a.f90:6:30:

    6 |    print*, atan(y,x), atan2(y,x)
      |                              1
Error: ‘x’ argument of ‘atan2’ intrinsic at (1) must be the same type
and kind as ‘y’

The error message for atan(y,x) is wrong.

Reply via email to