Fix compilation failure with C++98 compilers
[official-gcc.git] / gcc / testsuite / gfortran.dg / protected_7.f90
blob0f84da54886acba89494bf1bb921511d2d06be27
1 ! { dg-do compile }
2 ! PR fortran/37504
4 module m
5 implicit none
6 integer, pointer, protected :: protected_pointer
7 integer, target, protected :: protected_target
8 end module m
10 program p
11 use m
12 implicit none
13 integer, pointer :: unprotected_pointer
14 ! The next two lines should be rejected; see PR 37513 why
15 ! we get such a strange error message.
16 protected_pointer => unprotected_pointer ! { dg-error "pointer association context" }
17 protected_pointer = unprotected_pointer ! OK
18 unprotected_pointer => protected_target ! { dg-error "target has PROTECTED attribute" }
19 unprotected_pointer => protected_pointer ! OK
20 end program p