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

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


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

Build fails with `-DFLANG_ENABLE_WERROR=ON`.

>From ef5574e7e4507aa667b4714571590e7f85ef0437 Mon Sep 17 00:00:00 2001
From: Kelvin Li <kli at ca.ibm.com>
Date: Mon, 1 Jun 2026 14:55:41 -0400
Subject: [PATCH] [flang] Fix possibly unused variable (NFC)

---
 flang/lib/Lower/OpenMP/Atomic.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);



More information about the flang-commits mailing list