Debian Codegraph @

gcc/testsuite/gfortran.dg/warn_target_lifetime_4.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-Wtarget-lifetime" }
3 !
4 ! PR fortran/81770: [5/6/7 Regression] Bogus warning: Pointer in pointer assignment might outlive the pointer target
5 !
6 ! Contributed by Janus Weil <[email protected]>
7
8 module m
9
10 type t
11 integer, allocatable :: l
12 end type
13
14 contains
15
16 subroutine sub(c_in, list)
17 type(t), target, intent(in) :: c_in
18 integer, pointer, intent(out) :: list
19
20 type(t), pointer :: container
21
22 container => c_in
23
24 list => container%l
25
26 end subroutine
27
28 end