[flang] FindContainingSubprogram returns a pointer, not a reference.
authorSteve Scalpone <sscalpone@nvidia.com>
Mon, 15 Apr 2019 17:09:40 +0000 (10:09 -0700)
committerSteve Scalpone <sscalpone@nvidia.com>
Mon, 15 Apr 2019 17:59:12 +0000 (10:59 -0700)
Original-commit: flang-compiler/f18@7d221b09bd9b77800d85e9bc2a0084a95237be65

flang/lib/semantics/check-return.cc

index 19d4994e50d929770e9e9183cebd4280b9494147..d41d55274fe953d7d4e7497d8049acae2860155d 100644 (file)
@@ -39,7 +39,7 @@ void ReturnStmtChecker::Leave(const parser::ReturnStmt &returnStmt) {
   // C1575 The scalar-int-expr is allowed only in the inclusive scope of a
   // subroutine subprogram.
   const auto &scope{context_.FindScope(*context_.location())};
-  const auto &subprogramScope{FindContainingSubprogram(scope)};
+  const auto *subprogramScope{FindContainingSubprogram(scope)};
   if (subprogramScope == nullptr) {
     context_.Say(
         "RETURN must in the inclusive scope of a SUBPROGRAM"_err_en_US);