[flang-commits] [flang] [flang] Add deviation to the spec that declaring the same variable is permitted (PR #148288)

via flang-commits flang-commits at lists.llvm.org
Fri Jul 11 13:19:02 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-openacc

Author: Susan Tan (ス-ザン タン) (SusanTan)

<details>
<summary>Changes</summary>

OpenACC spec says `A var may appear at most once in all the clauses of declare directives for a function, subroutine, program, or module.` but our implementation allows it with a warning generated. Add this to the diviation list for record.



---
Full diff: https://github.com/llvm/llvm-project/pull/148288.diff


1 Files Affected:

- (modified) flang/docs/OpenACC.md (+3) 


``````````diff
diff --git a/flang/docs/OpenACC.md b/flang/docs/OpenACC.md
index 87f30ccd953b6..cbb2a91f0963b 100644
--- a/flang/docs/OpenACC.md
+++ b/flang/docs/OpenACC.md
@@ -27,6 +27,9 @@ local:
 * `!$acc cache` directive accepts scalar variable.
 * The `!$acc declare` directive accepts assumed size array arguments for 
   `deviceptr` and `present` clauses.
+* The OpenACC specification disallows a variable appearing multiple times in
+  clauses of `!$acc declare` directives for a function, subroutine, program,
+  or module, but we allow it with a warning.
 
 ## Remarks about incompatibilities with other implementations
 * Array element references in the data clauses are equivalent to array sections

``````````

</details>


https://github.com/llvm/llvm-project/pull/148288


More information about the flang-commits mailing list