[flang-commits] [flang] [flang] Fix warning in build (PR #100134)

via flang-commits flang-commits at lists.llvm.org
Tue Jul 23 07:49:19 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

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

Author: Pete Steinfeld (psteinfeld)

<details>
<summary>Changes</summary>

After tblah's update #<!-- -->99817, I'm getting a warning about an unusedvariable.  It looks to me like the warning is bogus, possibly due to a bug in the compiler I'm using (GCC 9.3.0).  But adding a "maybe_unused" clause fixes it and makes my builds clean.

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


1 Files Affected:

- (modified) flang/lib/Lower/DirectivesCommon.h (+2-1) 


``````````diff
diff --git a/flang/lib/Lower/DirectivesCommon.h b/flang/lib/Lower/DirectivesCommon.h
index 5b8d1f2359c5b..24cb7c2fcf7db 100644
--- a/flang/lib/Lower/DirectivesCommon.h
+++ b/flang/lib/Lower/DirectivesCommon.h
@@ -137,7 +137,8 @@ static inline void genOmpAtomicHintAndMemoryOrderClauses(
 }
 
 template <typename AtomicListT>
-static void processOmpAtomicTODO(mlir::Type elementType, mlir::Location loc) {
+static void processOmpAtomicTODO(mlir::Type elementType,
+                                 [[maybe_unused]] mlir::Location loc) {
   if (!elementType)
     return;
   if constexpr (std::is_same<AtomicListT,

``````````

</details>


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


More information about the flang-commits mailing list