- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
the following allocatable statement produce a internal compiler, I am pretty sure this is forbidden though.
program foo
implicit none
class(*),allocatable :: val
allocate(val,mold=null())
allocate(val,source=null())
end program
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree that this is not allowed, though I am still looking for the right words in the standard to say so. That NULL() is not allocated and is being used in an expression suggests to me a violation of the rule about references to unallocated variables. Nevertheless, an internal compiler error is not the appropriate response and I will let the developers know. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Found it: "If source-expr is a pointer, it shall be associated with a target. If source-expr is allocatable, it shall be allocated." (6.7.1.2 Execution of an ALLOCATE statement, paragraph 5). Issue ID is DPD200375620.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed for a future major release.
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