From 6778aa5c4f7dd2e48f5e8b473acc91163a504465 Mon Sep 17 00:00:00 2001 From: Tim Keith Date: Tue, 23 Oct 2018 17:09:26 -0700 Subject: [PATCH] [flang] Fix failure to resolve submodule name. If we have `SUBMODULE(m:s1) s2` and `s1` is already in memory (i.e. does not need to be read from the `m-s1.mod` file), we still need to record the fact that the name is a reference to that module symbol. Original-commit: flang-compiler/f18@4bb42ed6a4f7da9772903bd411146b989aff8367 Reviewed-on: https://github.com/flang-compiler/f18/pull/218 Tree-same-pre-rewrite: false --- flang/lib/semantics/mod-file.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/flang/lib/semantics/mod-file.cc b/flang/lib/semantics/mod-file.cc index 14a8666..68ecede 100644 --- a/flang/lib/semantics/mod-file.cc +++ b/flang/lib/semantics/mod-file.cc @@ -465,6 +465,7 @@ Scope *ModFileReader::Read(const SourceName &name, Scope *ancestor) { std::string ancestorName; // empty for module if (ancestor) { if (auto *scope{ancestor->FindSubmodule(name)}) { + scope->symbol()->add_occurrence(name); return scope; } ancestorName = ancestor->name().ToString(); -- 2.7.4