[flang-commits] [flang] [flang] Fix possibly unused variable (NFC) (PR #200905)

via flang-commits flang-commits at lists.llvm.org
Mon Jun 1 11:58:51 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-fir-hlfir

Author: Kelvin Li (kkwli)

<details>
<summary>Changes</summary>

Build fails with `-DFLANG_ENABLE_WERROR=ON`.

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


1 Files Affected:

- (modified) flang/lib/Lower/OpenMP/Atomic.cpp (+1-1) 


``````````diff
diff --git a/flang/lib/Lower/OpenMP/Atomic.cpp b/flang/lib/Lower/OpenMP/Atomic.cpp
index b80564fddd943..9d711b92bb520 100644
--- a/flang/lib/Lower/OpenMP/Atomic.cpp
+++ b/flang/lib/Lower/OpenMP/Atomic.cpp
@@ -650,7 +650,7 @@ void Fortran::lower::omp::lowerAtomic(
     // writeActionCond is a bitmask combining the following flags:
     //  1) the action type (Read/Write/Update)
     //  2) condition (IfTrue/IfFalse)
-    int writeActionCond = 0;
+    [[maybe_unused]] int writeActionCond = 0;
     const evaluate::Assignment *writeAssign = nullptr;
     if (analysis.op0.what & analysis.Write) {
       writeAssign = get(analysis.op0.assign);

``````````

</details>


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


More information about the flang-commits mailing list