[flang-commits] [flang] [flang] Fix build warning on now-unused variable (PR #70852)

via flang-commits flang-commits at lists.llvm.org
Tue Oct 31 12:53:22 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

<details>
<summary>Changes</summary>

A recent change of mine caused a local variable to become obsolete in its function, leading to a warning with some build compilers that is fatal under -Werror, breaking a build bot.  Remove the variable.

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


1 Files Affected:

- (modified) flang/lib/Evaluate/type.cpp (-2) 


``````````diff
diff --git a/flang/lib/Evaluate/type.cpp b/flang/lib/Evaluate/type.cpp
index 72e385104cd6412..9c5c57a45aee59f 100644
--- a/flang/lib/Evaluate/type.cpp
+++ b/flang/lib/Evaluate/type.cpp
@@ -37,9 +37,7 @@ static bool IsDescriptor(const ObjectEntityDetails &details) {
   if (IsDescriptor(details.type()) || details.IsAssumedRank()) {
     return true;
   }
-  std::size_t j{0};
   for (const ShapeSpec &shapeSpec : details.shape()) {
-    ++j;
     if (const auto &ub{shapeSpec.ubound().GetExplicit()}) {
       if (!IsConstantExpr(*ub)) {
         return true;

``````````

</details>


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


More information about the flang-commits mailing list