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

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Oct 31 12:52:14 PDT 2023


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

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.

>From 3f9e59eb34337a4184679ce0aead23ea01a8b1cf Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Tue, 31 Oct 2023 12:50:14 -0700
Subject: [PATCH] [flang] Fix build warning on now-unused variable

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.
---
 flang/lib/Evaluate/type.cpp | 2 --
 1 file changed, 2 deletions(-)

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;



More information about the flang-commits mailing list