-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[flang][runtime] Allow some list-directed child output to advance #166847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
List-directed child input is allowed to advance to new records in some circumstances, and list-directed output should be as well so that e.g. NAMELIST output via a defined WRITE(FORMATTED) generic doesn't get truncated by FORT_FMT_RECL. Fixes llvm#166804.
|
The reduced test case is fixed as well as the corresponding portion of the full test case. However, the full test case still fails probably due to a different variation. Update: The full test case is actually passing. The failure I saw was due to an IBM extension that allows "true" dynamic type in array constructor. |
|
Please attach full test cases to bugs so that I don't have to fix things twice. |
…vm#166847) List-directed child input is allowed to advance to new records in some circumstances, and list-directed output should be as well so that e.g. NAMELIST output via a defined WRITE(FORMATTED) generic doesn't get truncated by FORT_FMT_RECL. Fixes llvm#166804.
The test case is testing the dynamic type of the AC value rather than it's declare type as the standard says (Its dynamic type is its declared type). It is an extension to the standard. Would it be a candidate extension for Flang as well? |
I don't understand this, but if you show me a test case in point out the behavior that you want, I'll be happy to consider an extension. |
For this code, XLF has an compile time option to use the dynamic type of instead of This is not related to DTIO rather an extension to the array constructor. |
|
If the extension only pertains to |
|
Sure. With the extension, XLF prints Without , it prints |
|
So the extension is to interpret an array constructor with no explicit type-spec as having the dynamic type of its elements, not their common declared type, when the elements are polymorphic? And this is independent of the context -- it is not peculiar to |
|
Right. It could be at other places where the array constructor is used. (Not limited to the |
Thanks for the confirmation. In short, you want polymorphic array constructors that would work like anonymous polymorphic allocatables. Does any Fortran compiler besides XLF support this feature? |
|
Not really. Even for XLF, it is not the default behavior. We have some test cases that are testing this non-default option and behavior. |
|
Ok, thanks. I think I'll leave this extension unimplemented until/unless there's a request for it from an application or library developer. |
List-directed child input is allowed to advance to new records in some circumstances, and list-directed output should be as well so that e.g. NAMELIST output via a defined WRITE(FORMATTED) generic doesn't get truncated by FORT_FMT_RECL.
Fixes #166804.