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

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Tue Mar 24 17:56:20 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");
----------------
luporl wrote:

I remember that when this assert was added it could trigger in some cases, but never when at least one symbol was found.
If it's not hit when running gfortran and Fujitsu testsuites, then this might not be the case anymore.

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


More information about the flang-commits mailing list