- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the following code, the abstract derived type T features a procedure binding TP for a deferred procedure T_P which has the RECURSIVE attribute.
TT is a concrete extension of T which associates the TP binding with the type-bound procedure TT_P which has the NON_RECURSIVE attribute.
The compiler does not emit an error for this discrepancy (it does if you try the pair of mismatched attributes PURE/IMPURE). Is this a compiler bug?
MODULE M
IMPLICIT NONE
TYPE, ABSTRACT :: T
CONTAINS
PROCEDURE(T_P), DEFERRED, PRIVATE :: TP
END TYPE T
ABSTRACT INTERFACE
RECURSIVE SUBROUTINE T_P(SELF)
IMPORT, ALL
IMPLICIT NONE
CLASS(T), INTENT(IN) :: SELF
END SUBROUTINE T_P
END INTERFACE
TYPE, EXTENDS(T) :: TT
CONTAINS
PROCEDURE, PUBLIC :: TP => TT_P
END TYPE TT
CONTAINS
NON_RECURSIVE SUBROUTINE TT_P(SELF)
IMPLICIT NONE
CLASS(TT), INTENT(IN) :: SELF
END SUBROUTINE TT_P
END MODULE M
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is a bug. Bug ID is CMPLRLLVM-69417

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