Skip to content

Commit 7a13a75

Browse files
authored
[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.
1 parent 442ae60 commit 7a13a75

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

flang/docs/Extensions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,16 @@ print *, [(j,j=1,10)]
900900
since these default values need to be available to process incomplete
901901
structure constructors.
902902

903+
* When an `ALLOCATE` or `DEALLOCATE` statement with multiple variables
904+
has a `STAT=` specifier that allows the program to continue execution
905+
after an error, the variables after the one with the error are left
906+
deallocated (or allocated). This interpretation allows the program to
907+
identify the variable that encountered the problem while avoiding any
908+
ambiguity in the case of multiple errors with distinct status codes.
909+
Some compilers work differently; for maximum portability, avoid
910+
`ALLOCATE` and `DEALLOCATE` statements with error recovery for
911+
multiple variables.
912+
903913
## De Facto Standard Features
904914

905915
* `EXTENDS_TYPE_OF()` returns `.TRUE.` if both of its arguments have the

0 commit comments

Comments
 (0)