[flang-commits] [flang] 76c1665 - [flang] Fix warnings

Kazu Hirata via flang-commits flang-commits at lists.llvm.org
Mon Nov 4 09:31:35 PST 2024


Author: Kazu Hirata
Date: 2024-11-04T09:31:29-08:00
New Revision: 76c16651c9f003332bff473d6703cf5bef367c99

URL: https://github.com/llvm/llvm-project/commit/76c16651c9f003332bff473d6703cf5bef367c99
DIFF: https://github.com/llvm/llvm-project/commit/76c16651c9f003332bff473d6703cf5bef367c99.diff

LOG: [flang] Fix warnings

This patch fixes:

  flang/lib/Semantics/check-omp-structure.cpp:286:27: error: lambda
  capture 'this' is not used [-Werror,-Wunused-lambda-capture]

  flang/lib/Semantics/check-omp-structure.cpp:299:21: error: private
  field 'sctx_' is not used [-Werror,-Wunused-private-field]

Added: 
    

Modified: 
    flang/lib/Semantics/check-omp-structure.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index 5aca7a3ea851de..60b9759f0a6eb8 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -283,7 +283,7 @@ struct ContiguousHelper {
     return Visit(x.get());
   }
   template <typename T> std::optional<bool> Visit(const evaluate::Expr<T> &x) {
-    return common::visit([this](auto &&s) { return Visit(s); }, x.u);
+    return common::visit([&](auto &&s) { return Visit(s); }, x.u);
   }
   template <typename T>
   std::optional<bool> Visit(const evaluate::Designator<T> &x) {
@@ -296,7 +296,7 @@ struct ContiguousHelper {
   }
 
 private:
-  SemanticsContext &sctx_;
+  [[maybe_unused]] SemanticsContext &sctx_;
   evaluate::FoldingContext &fctx_;
 };
 } // namespace


        


More information about the flang-commits mailing list