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

    <tr>
        <th>Summary</th>
        <td>
            [Flang] Compilation error when pointer points to intrinsic function in pointer assignment statement
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang:frontend
      </td>
    </tr>

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

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

<pre>
    ```
Version of flang-new : 19.0.0(41211919db5feb279d2954eb590a3cf2a1742152)/AArch64
```

When `pointer` points to `intrinsic function (sin)` in `pointer assignment statement`, a compilation error occurs.  
When `module` is expanded into the `main program`, the compilation is successful.  
The fixed program is `PH09644_9_23.f90`.

The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.

PH09644_9_22.f90:
```fortran
module m
 procedure(),pointer,save :: p
end module m

program main
  use m
  intrinsic sin
  p=>sin
  print *,'PASS'
end program main
```

```
$ flang-new PH09644_9_22.f90
error: Semantic errors in PH09644_9_.f90
./PH09644_9_.f90:9:3: error: Subroutine pointer 'p' may not be associated with function designator 'sin'
    p=>sin
 ^^^^^^
./PH09644_9_.f90:2:26: Declaration of 'p'
 procedure(),pointer :: p
 ^
$
```

```
$ gfortran PH09644_9_22.f90; ./a.out
 PASS
$
```

```
$ ifort -diag-disable=10448 PH09644_9_22.f90; ./a.out
 PASS
$
```

PH09644_9_23.f90:
```fortran
program main
 procedure(),pointer,save :: p
  intrinsic sin
  p=>sin
  print *,'PASS'
end program main
```

```
$ flang-new -fopenmp PH09644_9_23.f90; ./a.out
 PASS
$
```

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