[Bug fortran/96398] New: ASSOCIATE with pointer fails in older GCC versions
m.deij at marin dot nl
gcc-bugzilla@gcc.gnu.org
Fri Jul 31 08:11:26 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96398
Bug ID: 96398
Summary: ASSOCIATE with pointer fails in older GCC versions
Product: gcc
Version: 6.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: m.deij at marin dot nl
Target Milestone: ---
When I compile the code below with 6.3.1, I get the following error. Versions
8.3.1 and 9.2.0 are OK (I have no other versions to test with).
=================================================
print*, b2Ptr%a
1
Error: Symbol 'b2ptr' at (1) has no IMPLICIT type
=================================================
MODULE bodies
IMPLICIT NONE
TYPE BodyClass
INTEGER :: a
END TYPE
TYPE(BodyClass),POINTER :: aBody
CONTAINS
FUNCTION bodies_getBody() result(body)
TYPE(BodyClass),POINTER :: body
body = aBody
END FUNCTION
END MODULE
MODULE aModule
USE bodies
IMPLICIT NONE
CONTAINS
SUBROUTINE try
TYPE(BodyClass), POINTER :: bPtr
! no problem assigning a pointer
bPtr => bodies_getBody()
print *, bPtr%a
! this is problematic
ASSOCIATE(b2Ptr => bodies_getBody())
print*, b2Ptr%a
END ASSOCIATE
END SUBROUTINE
END MODULE
More information about the Gcc-bugs
mailing list