<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60227>60227</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] Compilation error of sign intrinsic function in function named sign
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
Version of flang-new : 16.0.0(77f2f34d696b77fe5bf05afbe7386966b6bcc8ba)
```

`Sign` intrinsic function in a function named sign results in a compilation-time error.

The following are the test program, flang-new, gfortran and ifort compilation result.

snggg865_.f90:
```fortran
module mod
  interface sign
     module procedure sign
  end interface sign
contains
  function sign (a1, a2, a3) result (data_sign)
 real, intent (In):: a1, a2, a3
    real:: data_sign
    data_sign = + sign (a1, a3)
  end function sign
end module mod

program main
  use mod
  !  write(6,*) "sign(2.0, 1.0,1.0) = ", sign(2.0, 1.0,1.0)
  if (abs(sign(2.0, 1.0,1.0)-2.0)>0.0001) write(6,*) "NG+"
end program main
```

```
$ flang-new -flang-experimental-exec snggg865_2.f90
error: Semantic errors in snggg865_2.f90
./snggg865_2.f90:9:19: error: Dummy argument 'a3=' (#3) is not OPTIONAL and is not associated with an actual argument in this procedure reference
      data_sign = + sign (a1, a3)
 ^^^^^^^^^^^^^
$
```

```
$ gfortran snggg865_2.f90
snggg865_2.f90:9:22:

     data_sign = + sign (a1, a3)
                      1
Error: There is no specific function for the generic 'sign' at (1)
snggg865_2.f90:14:6:

   use mod
 1
Fatal Error: Can't open module file 'mod.mod' for reading at (1): No such file or directory
compilation terminated.
$
```

```
$ ifort snggg865_2.f90
$
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVkuP4ygQ_jXkUoqFIX4dcsh0JquRVj0rTWuvI4zLNiMbIsDb0_9-BU6cR6el7Y0sHKqKqv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