diff options
Diffstat (limited to 'flang/lib/Semantics/mod-file.cpp')
-rw-r--r-- | flang/lib/Semantics/mod-file.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp index 0f6117b..36b2341 100644 --- a/flang/lib/Semantics/mod-file.cpp +++ b/flang/lib/Semantics/mod-file.cpp @@ -422,7 +422,12 @@ static const Attrs subprogramPrefixAttrs{Attr::ELEMENTAL, Attr::IMPURE, void ModFileWriter::PutSubprogram(const Symbol &symbol) { auto &details{symbol.get<SubprogramDetails>()}; if (const Symbol * interface{details.moduleInterface()}) { - PutSubprogram(*interface); + const Scope *module{FindModuleContaining(interface->owner())}; + if (module && module != &symbol.owner()) { + // Interface is in ancestor module + } else { + PutSubprogram(*interface); + } } auto attrs{symbol.attrs()}; Attrs bindAttrs{}; |