2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / change_symbol_attributes_1.f90
blob9b6ed37693be81bf6c2c8e5a0423c5c572926af7
1 ! { dg-do compile }
2 ! Fix for PR21730 - declarations used to produce the error:
3 ! target :: x ! these 2 lines interchanged
4 ! 1
5 ! Error: Cannot change attributes of symbol at (1) after it has been used.
7 ! Contributed by Harald Anlauf <anlauf@gmx.de>
9 subroutine gfcbug27 (x)
10 real, intent(inout) :: x(:)
12 real :: tmp(size (x,1)) ! gfc produces an error unless
13 target :: x ! these 2 lines interchanged
14 real, pointer :: p(:)
16 p => x(:)
17 end subroutine gfcbug27