This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/81770] New: [5/6/7 Regression] Bogus warning: Pointer in pointer assignment might outlive the pointer target
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 08 Aug 2017 13:27:32 +0000
- Subject: [Bug fortran/81770] New: [5/6/7 Regression] Bogus warning: Pointer in pointer assignment might outlive the pointer target
- Auto-submitted: auto-generated
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]