Skip to content

Conversation

@kparzysz
Copy link
Contributor

@kparzysz kparzysz commented Sep 3, 2025

block is a global variable that represents the Block parser, so avoid using local variables with the same name.

`block` is a global variable that represents the Block parser, so avoid
using local variables with the same name.
@kparzysz kparzysz requested review from Stylie777 and tblah September 3, 2025 15:48
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:parser labels Sep 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 3, 2025

@llvm/pr-subscribers-flang-parser

Author: Krzysztof Parzyszek (kparzysz)

Changes

block is a global variable that represents the Block parser, so avoid using local variables with the same name.


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

1 Files Affected:

  • (modified) flang/lib/Parser/openmp-parsers.cpp (+3-3)
diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index cc4e59d318bbe..1b7665ce4acf5 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -1289,9 +1289,9 @@ struct StrictlyStructuredBlockParser {
     if (lookAhead(skipStuffBeforeStatement >> "BLOCK"_tok).Parse(state)) {
       if (auto epc{Parser<ExecutionPartConstruct>{}.Parse(state)}) {
         if (IsFortranBlockConstruct(*epc)) {
-          Block block;
-          block.emplace_back(std::move(*epc));
-          return std::move(block);
+          Block body;
+          body.emplace_back(std::move(*epc));
+          return std::move(body);
         }
       }
     }

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kparzysz kparzysz merged commit f8f96a4 into llvm:main Sep 4, 2025
12 checks passed
@kparzysz kparzysz deleted the users/kparzysz/rename-block branch September 4, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:parser flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants