[flang][NFC] Document ALLOCATE/DEALLOCATE error semantics (#153027)

This compiler stops an ALLOCATE/DEALLOCATE statement with multiple
variables after encountering a recoverable error to avoid the risk of
ambiguity in the case of multiple errors. Document.
This commit is contained in:
Peter Klausler 2025-08-13 14:36:51 -07:00 committed by GitHub
parent 442ae603c5
commit 7a13a756d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -900,6 +900,16 @@ print *, [(j,j=1,10)]
since these default values need to be available to process incomplete since these default values need to be available to process incomplete
structure constructors. structure constructors.
* When an `ALLOCATE` or `DEALLOCATE` statement with multiple variables
has a `STAT=` specifier that allows the program to continue execution
after an error, the variables after the one with the error are left
deallocated (or allocated). This interpretation allows the program to
identify the variable that encountered the problem while avoiding any
ambiguity in the case of multiple errors with distinct status codes.
Some compilers work differently; for maximum portability, avoid
`ALLOCATE` and `DEALLOCATE` statements with error recovery for
multiple variables.
## De Facto Standard Features ## De Facto Standard Features
* `EXTENDS_TYPE_OF()` returns `.TRUE.` if both of its arguments have the * `EXTENDS_TYPE_OF()` returns `.TRUE.` if both of its arguments have the