Files
clang-p2996/flang/test/Semantics/abstract02.f90
Peter Klausler 5de49af540 [flang] Abstract interfaces can't be designated or referenced
Broaden the check for misuse of ABSTRACT procedure interfaces by
doing it in expression analysis rather than name resolution so that
cases like pointer assignment targets and actual arguments are also
diagnosed as errors.

Differential Revision: https://reviews.llvm.org/D136971
2022-10-29 18:06:04 -07:00

18 lines
623 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! Test misuse of abstract interfaces
program test
abstract interface
subroutine abstract
end subroutine
end interface
procedure(abstract), pointer :: p
!ERROR: Abstract procedure interface 'abstract' may not be referenced
call abstract
!ERROR: Abstract procedure interface 'abstract' may not be used as a designator
p => abstract
!ERROR: Abstract procedure interface 'abstract' may not be used as a designator
call foo(abstract)
!ERROR: Abstract procedure interface 'abstract' may not be used as a designator
print *, associated(p, abstract)
end