A module procedure interface body can access entities in its host
without an IMPORT statement. So the `ImportKind` of the scope created
for such an interface body should be `Default`, not `None` as it is
for other interface bodies.
Original-commit: flang-compiler/f18@
24bb2668fdb626a4df76719345b02e533d015d79
Reviewed-on: https://github.com/flang-compiler/f18/pull/305
Tree-same-pre-rewrite: false
if (importKind_) {
return *importKind_;
}
- if (symbol_) {
+ if (symbol_ && !symbol_->attrs().test(Attr::MODULE)) {
if (auto *details{symbol_->detailsIf<SubprogramDetails>()}) {
if (details->isInterface()) {
- return ImportKind::None; // default for interface body
+ return ImportKind::None; // default for non-mod-proc interface body
}
}
}
-! Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+! Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
!
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
!REF: /m/t
!DEF: /m/x PUBLIC ObjectEntity TYPE(t)
type(t) :: x
+ interface
+ !DEF: /m/s3 MODULE, PUBLIC Subprogram
+ !DEF: /m/s3/y ObjectEntity TYPE(t)
+ module subroutine s3(y)
+ !REF: /m/t
+ !REF: /m/s3/y
+ type(t) :: y
+ end subroutine
+ end interface
contains
!DEF: /m/s PUBLIC Subprogram
subroutine s