-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Flang] Incorrect diagnostic due to private generic name still visible outside of the module. #126797
Comments
@llvm/issue-subscribers-flang-frontend Author: Daniel Chen (DanielCChen)
Consider the following code:
```
module m
type base
character(3) :: c = 'xxx'
contains
procedure, pass :: write => writeb
generic, private :: write(unformatted) => write !! generic write(unformated) is private, so it should not
!! be accessible outside of the module
end type
interface contains
end module program resolve005a allocate ( b1, source = base('abc') ) call mywrite ( b1, stat, msg) deallocate(b1) end program subroutine writeb (dtv, unit, iostat, iomsg) interface write(unformatted). !! This declaration should be allowed. write (unit, iostat=iostat, iomsg=iomsg) dtv end subroutine subroutine writebaseext (dtv, unit, iostat, iomsg) select type ( dtv )
error: Semantic errors in t1.f
|
Fixed test above to remove a spurious period on line 54. |
When checking for conflicts between type-bound generic defined I/O procedures and non-type-bound defined I/O generic interfaces, don't worry about conflicts where the type-bound generic interface is inaccessible in the scope around the non-type-bound interface. Fixes llvm#126797.
Consider the following code:
The test case in intentionally testing when a generic name is private, it should be allowed to declare another interface outside of the module.
Flang is currently issue an error as
The text was updated successfully, but these errors were encountered: