https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81770
Bug ID: 81770 Summary: [5/6/7 Regression] Bogus warning: Pointer in pointer assignment might outlive the pointer target Product: gcc Version: 7.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: janus at gcc dot gnu.org Target Milestone: --- Please consider this test case: module m type t integer, allocatable :: l end type contains subroutine sub(c_in, list) type(t), target, intent(in) :: c_in integer, pointer, intent(out) :: list type(t), pointer :: container container => c_in list => container%l end subroutine end Since version 4.8 gfortran with -Wall gives the bogus warning: list => container%l 1 Warning: Pointer at (1) in pointer assignment might outlive the pointer target [-Wtarget-lifetime]