1! RUN: %S/test_errors.sh %s %t %flang_fc1
2! REQUIRES: shell
3! C1003 - can't parenthesize function call returning procedure pointer
4module m1
5  type :: dt
6    procedure(frpp), pointer, nopass :: pp
7  end type dt
8 contains
9  subroutine boring
10  end subroutine boring
11  function frpp
12    procedure(boring), pointer :: frpp
13    frpp => boring
14  end function frpp
15  subroutine tests
16    procedure(boring), pointer :: mypp
17    type(dt) :: dtinst
18    mypp => boring ! legal
19    mypp => (boring) ! legal, not a function reference
20    !ERROR: A function reference that returns a procedure pointer may not be parenthesized
21    mypp => (frpp()) ! C1003
22    mypp => frpp() ! legal, not parenthesized
23    dtinst%pp => frpp
24    mypp => dtinst%pp() ! legal
25    !ERROR: A function reference that returns a procedure pointer may not be parenthesized
26    mypp => (dtinst%pp())
27  end subroutine tests
28end module m1
29