- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Abhi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I have reproduced this behavior andbelieve it agrees with the Fortran 2003 standard:
"21 C439 (R440) If the POINTER attribute is specified for a component, the declaration-type-spec in the
22 component-def-stmt shall be CLASS(*) or shall specify an intrinsic type or any accessible derived
23 type including the type being defined."
In this case, POINTER is specified so the only CLASS allowed is CLASS(*).
------
Wendy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't think the fact that it is polymorphic matters. Compare the wording of the constraint quoted with the one immediately before (C438 in F2003) which applies to non-pointer components - if you applied the same logic/interpretation to it then you'd be saying that you couldn't have any allocatable polymorphic components that were not CLASS(*). That would be a bit of a bummer.
Besides which, F2008 relaxes things even further, so Arjen's just ahead of the game in terms of his understanding of the fine print...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to use a "forward-reference" to a module. Is there any way to do this; e.g., pre-compiled modules? My desired code sequence would have the following pattern:
- module M1 source. This references subroutine S2.
- module M2 source. This contains subroutine S2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is really a very different question from what this thread is about - in the future, please start a new topic with new questions.
In the scenario you describe, module M1 would USE M2. M2 could not use M1. The build system will build sources in the correct order - M2 would have to be compiled already before M1 is compiled.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page