1! { dg-do compile }
2
3program test
4  implicit none
5  integer :: i
6
7  !$acc declare copy(i)
8contains
9  real function foo(n)
10    integer, value :: n
11    BLOCK
12       integer i
13       !$acc declare copy(i) ! { dg-error "is not allowed" }
14    END BLOCK
15  end function foo
16end program test
17