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 <janus@gcc.gnu.org> 7 8module m 9 10 type t 11 integer, allocatable :: l 12 end type 13 14contains 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 28end 29