2021-04-12 20:27:49 +08:00
|
|
|
! RUN: %S/test_errors.sh %s %t %flang_fc1
|
2019-03-12 06:39:11 +08:00
|
|
|
! C1003 - can't parenthesize function call returning procedure pointer
|
|
|
|
module m1
|
|
|
|
type :: dt
|
2019-06-24 01:59:32 +08:00
|
|
|
procedure(frpp), pointer, nopass :: pp
|
2019-03-12 06:39:11 +08:00
|
|
|
end type dt
|
|
|
|
contains
|
|
|
|
subroutine boring
|
|
|
|
end subroutine boring
|
|
|
|
function frpp
|
|
|
|
procedure(boring), pointer :: frpp
|
|
|
|
frpp => boring
|
|
|
|
end function frpp
|
|
|
|
subroutine tests
|
|
|
|
procedure(boring), pointer :: mypp
|
|
|
|
type(dt) :: dtinst
|
|
|
|
mypp => boring ! legal
|
|
|
|
mypp => (boring) ! legal, not a function reference
|
2019-09-14 04:57:35 +08:00
|
|
|
!ERROR: A function reference that returns a procedure pointer may not be parenthesized
|
2019-03-12 06:39:11 +08:00
|
|
|
mypp => (frpp()) ! C1003
|
|
|
|
mypp => frpp() ! legal, not parenthesized
|
|
|
|
dtinst%pp => frpp
|
|
|
|
mypp => dtinst%pp() ! legal
|
2019-09-14 04:57:35 +08:00
|
|
|
!ERROR: A function reference that returns a procedure pointer may not be parenthesized
|
2019-03-12 06:39:11 +08:00
|
|
|
mypp => (dtinst%pp())
|
|
|
|
end subroutine tests
|
|
|
|
end module m1
|