projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2d6bbc
)
[flang] Avoid copying scope. Improve readability.
author
Steve Scalpone
<sscalpone@nvidia.com>
Mon, 15 Apr 2019 16:41:27 +0000
(09:41 -0700)
committer
Steve Scalpone
<sscalpone@nvidia.com>
Mon, 15 Apr 2019 17:59:12 +0000
(10:59 -0700)
Original-commit: flang-compiler/f18@
5d2213cd7a68e9d125304e5d2e6e7e7fd8472b99
Tree-same-pre-rewrite: false
flang/lib/semantics/check-return.cc
patch
|
blob
|
history
diff --git
a/flang/lib/semantics/check-return.cc
b/flang/lib/semantics/check-return.cc
index
b280f13
..
19d4994
100644
(file)
--- a/
flang/lib/semantics/check-return.cc
+++ b/
flang/lib/semantics/check-return.cc
@@
-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);