Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / expr-errors01.f90
blob221a671b5b7c1f62f68d0f560f30baea8faae6e7
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C1003 - can't parenthesize function call returning procedure pointer
3 module m1
4 type :: dt
5 procedure(frpp), pointer, nopass :: pp
6 end type dt
7 contains
8 subroutine boring
9 end subroutine boring
10 function frpp
11 procedure(boring), pointer :: frpp
12 frpp => boring
13 end function frpp
14 subroutine tests
15 procedure(boring), pointer :: mypp
16 type(dt) :: dtinst
17 mypp => boring ! legal
18 mypp => (boring) ! legal, not a function reference
19 !ERROR: A function reference that returns a procedure pointer may not be parenthesized
20 mypp => (frpp()) ! C1003
21 mypp => frpp() ! legal, not parenthesized
22 dtinst%pp => frpp
23 mypp => dtinst%pp() ! legal
24 !ERROR: A function reference that returns a procedure pointer may not be parenthesized
25 mypp => (dtinst%pp())
26 end subroutine tests
27 end module m1