[flang-commits] [flang] [flang] Fix unused variable error (NFC) (PR #188358)

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Tue Mar 24 20:14:16 PDT 2026


================
@@ -535,10 +535,11 @@ void DataSharingProcessor::collectPrivatizedSymbols(
   };
 
   llvm::SetVector<const semantics::Scope *> clauseScopes;
-  const semantics::Scope *curScope = collectScopes(semaCtx, eval, clauseScopes);
+  [[maybe_unused]] const semantics::Scope *curScope =
+      collectScopes(semaCtx, eval, clauseScopes);
+  assert(curScope && "couldn't find current scope");
----------------
kkwli wrote:

The error occurs when building flang with `-DFLANG_ENABLE_WERROR=On`.

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


More information about the flang-commits mailing list