2 ! { dg-options "-std=f2003" }
5 ! Check for errors with ASSOCIATE during resolution.
11 INTEGER, POINTER :: ptr
13 ASSOCIATE (a => 5) ! { dg-error "is used as array" }
14 PRINT *, a(3) ! { dg-error "has an array reference" }
17 ASSOCIATE (a => nontarget)
18 ptr => a ! { dg-error "neither TARGET nor POINTER" }
21 ASSOCIATE (a => 5, b => arr((/ 1, 3 /)))
22 a = 4 ! { dg-error "variable definition context" }
23 b = 7 ! { dg-error "variable definition context" }
24 CALL test2 (a) ! { dg-error "variable definition context" }
25 CALL test2 (b) ! { dg-error "variable definition context" }
31 INTEGER, INTENT(IN) :: x
32 ASSOCIATE (y => x) ! { dg-error "variable definition context" }
33 y = 5 ! { dg-error "variable definition context" }
34 CALL test2 (x) ! { dg-error "variable definition context" }
38 ELEMENTAL SUBROUTINE test2 (x)
39 INTEGER, INTENT(OUT) :: x