2015-07-03 Christophe Lyon <christophe.lyon@linaro.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / protected_3.f90
blobe3d31a6bf8fde3cd9ac5d10ffd462363695f06fb
1 ! { dg-options "-std=f95 -fall-intrinsics" }
2 ! PR fortran/23994
4 ! Test PROTECTED attribute. Within the module everything is allowed.
5 ! Outside (use-associated): For pointers, their association status
6 ! may not be changed. For nonpointers, their value may not be changed.
8 ! Reject in Fortran 95
10 module protmod
11 implicit none
12 integer :: a
13 integer, target :: at
14 integer, pointer :: ap
15 protected :: a, at, ap ! { dg-error "Fortran 2003: PROTECTED statement" }
16 end module protmod
18 module protmod2
19 implicit none
20 integer, protected :: a ! { dg-error "Fortran 2003: PROTECTED attribute" }
21 integer, protected, target :: at ! { dg-error "Fortran 2003: PROTECTED attribute" }
22 integer, protected, pointer :: ap ! { dg-error "Fortran 2003: PROTECTED attribute" }
23 end module protmod2