llvm-project/flang/test/Semantics/resolve120.f90
Peter Klausler c81fe7f6ce
[flang] Fix GENERIC, PUBLIC/PRIVATE
The handling of accessibility attributes on GENERIC statements outside
derived type definitions is incorrect in name resolution.  Change it to
use the usual BeginAttrs()/EndAttrs() infrastructure.

Differential Revision: https://reviews.llvm.org/D159032
2023-08-29 08:35:11 -07:00

23 lines
513 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! Ensure that accessibility works on GENERIC statement
module m
generic, public :: public => specific
generic, private :: private => specific
contains
subroutine specific
end
end
program main
use m
generic :: public => internal
generic :: private => internal
call public
call public(1)
!ERROR: No specific subroutine of generic 'private' matches the actual arguments
call private
call private(1)
contains
subroutine internal(n)
end
end