Unverified Commit 4998587e authored by Daniel Chen's avatar Daniel Chen Committed by GitHub
Browse files

[Flang] Support for passing procedure pointer, reference to a function that...

[Flang] Support for passing procedure pointer, reference to a function that returns a procedure pointer to structure constructor. (#86533)

This PR fixes `not yet implemented: procedure pointer component in
structure constructor` as shown in the following test case.

```
  MODULE M
    TYPE :: DT
      PROCEDURE(Fun), POINTER, NOPASS :: pp1
    END TYPE

    CONTAINS

    INTEGER FUNCTION Fun(Arg)
    INTEGER :: Arg
      Fun = Arg
    END FUNCTION

  END MODULE

  PROGRAM MAIN
  USE M
  IMPLICIT NONE
  TYPE (DT) :: v2
  PROCEDURE(FUN), POINTER :: pp2
  v2 = DT(pp2)
  v2 = DT(bar())
  CONTAINS
    FUNCTION BAR() RESULT(res)
      PROCEDURE(FUN), POINTER :: res
    END
  END
  ```
parent 87519a28
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment