[flang-commits] [flang] [flang] Warn about undefined function results (PR #99533)

via flang-commits flang-commits at lists.llvm.org
Fri Jul 19 09:18:57 PDT 2024


https://github.com/jeanPerier commented:

Definition contexts are not the only way to define the result. There are at least three cases I can think of where this warning will probably be emitted in bogus manner:

```
real function defined_in_call()
  call init(defined_in_call)
end function

function defined_via_pointer()
  real, pointer :: p
  real, target :: defined_via_pointer
  p => defined_via_pointer
  p = 1
end function

subroutine init(x)
  real :: x
  x = 1
end subroutine

module test
  type t
    integer :: i = 1
  end type
contains
type(t) function defined_via_init()
end function
end module
```

https://github.com/llvm/llvm-project/pull/99533


More information about the flang-commits mailing list