Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Fix build warning on now-unused variable #70852

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

klausler
Copy link
Contributor

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.

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.
@klausler klausler merged commit b1b4bf0 into llvm:main Oct 31, 2023
2 checks passed
@klausler klausler deleted the fix-build branch October 31, 2023 19:52
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Oct 31, 2023
@llvmbot
Copy link
Member

llvmbot commented Oct 31, 2023

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

Changes

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 --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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants