[flang-commits] [flang] 7a13a75 - [flang][NFC] Document ALLOCATE/DEALLOCATE error semantics (#153027)

via flang-commits flang-commits at lists.llvm.org
Wed Aug 13 14:36:54 PDT 2025


Author: Peter Klausler
Date: 2025-08-13T14:36:51-07:00
New Revision: 7a13a756d6ed428aad580f46e2fd053b6b5cbb00

URL: https://github.com/llvm/llvm-project/commit/7a13a756d6ed428aad580f46e2fd053b6b5cbb00
DIFF: https://github.com/llvm/llvm-project/commit/7a13a756d6ed428aad580f46e2fd053b6b5cbb00.diff

LOG: [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.

Added: 
    

Modified: 
    flang/docs/Extensions.md

Removed: 
    


################################################################################
diff  --git a/flang/docs/Extensions.md b/flang/docs/Extensions.md
index 11c67176df200..b20503e542fb8 100644
--- a/flang/docs/Extensions.md
+++ b/flang/docs/Extensions.md
@@ -900,6 +900,16 @@ print *, [(j,j=1,10)]
   since these default values need to be available to process incomplete
   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 
diff erently; for maximum portability, avoid
+  `ALLOCATE` and `DEALLOCATE` statements with error recovery for
+  multiple variables.
+
 ## De Facto Standard Features
 
 * `EXTENDS_TYPE_OF()` returns `.TRUE.` if both of its arguments have the


        


More information about the flang-commits mailing list