[all-commits] [llvm/llvm-project] 4235bf: [flang] Adapt PointerIsAssociatedWith for empty de...

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Wed Mar 8 13:04:14 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4235bf7a0844bd1679c80f7a9166fbbfb363b5f4
      https://github.com/llvm/llvm-project/commit/4235bf7a0844bd1679c80f7a9166fbbfb363b5f4
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2023-03-08 (Wed, 08 Mar 2023)

  Changed paths:
    M flang/runtime/pointer.cpp

  Log Message:
  -----------
  [flang] Adapt PointerIsAssociatedWith for empty derived-type

When a derived-type as no component, its elem_len will be set to
zero when emboxed. Update the function to let empty derived-type
pointer/target succeed the test.

Example extracted from gfortran test pointer_init_8

```
module m
  type :: c
  end type c
  type, extends(c) :: d
  end type d
  type(c), target :: x
end module

use m
  class(c), pointer :: px => x

  if (.not. associated(px, x))   STOP 1
end
```

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D145604




More information about the All-commits mailing list