- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code ICEs with both ifort 2021.13.0 and ifx 2024.2.0:
MODULE M
IMPLICIT NONE (TYPE, EXTERNAL)
TYPE :: T
CLASS(T), POINTER :: PTR
CONTAINS
PROCEDURE :: GET_PTR
END TYPE T
CONTAINS
FUNCTION GET_PTR(SELF)
IMPLICIT NONE (TYPE, EXTERNAL)
CLASS(T), INTENT(INOUT) :: SELF
CLASS(T), POINTER :: GET_PTR
GET_PTR => SELF%PTR
END FUNCTION GET_PTR
END MODULE M
PROGRAM P
USE :: M
IMPLICIT NONE (TYPE, EXTERNAL)
TYPE (T), TARGET :: X1
TYPE (T) :: X2
X2%PTR => X1
WRITE(*, *) ASSOCIATED(X2%GET_PTR(), X1)
END PROGRAM P
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for reporting this. I escalated it to our developers. CMPLRLLVM-60612
In the meantime, a workaround is to use a temporary variable to hold the function result and passing that to ASSOCIATED
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page