forked from OSchip/llvm-project
[flang] Avoid copying scope. Improve readability.
Original-commit: flang-compiler/f18@5d2213cd7a Tree-same-pre-rewrite: false
This commit is contained in:
parent
e2d6bbc016
commit
05f0145be5
|
@ -38,8 +38,8 @@ void ReturnStmtChecker::Leave(const parser::ReturnStmt &returnStmt) {
|
|||
// subroutine subprogram.
|
||||
// C1575 The scalar-int-expr is allowed only in the inclusive scope of a
|
||||
// subroutine subprogram.
|
||||
auto scope{context_.FindScope(*context_.location())};
|
||||
auto subprogramScope{FindContainingSubprogram(scope)};
|
||||
const auto &scope{context_.FindScope(*context_.location())};
|
||||
const auto &subprogramScope{FindContainingSubprogram(scope)};
|
||||
if (subprogramScope == nullptr) {
|
||||
context_.Say(
|
||||
"RETURN must in the inclusive scope of a SUBPROGRAM"_err_en_US);
|
||||
|
|
Loading…
Reference in New Issue