summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/char_pointer_assign_6.f90
blob: cd90bfc06e343d6b612ac6844730a4cab020fd9f (plain)
1
2
3
4
5
6
7
8
9
10
11
! { dg-do compile }
! PR 31821
program main
  character (len=4), pointer:: s1
  character (len=20), pointer :: p1
  character (len=4) :: c
  s1 = 'abcd'
  p1 => s1(2:3) ! { dg-error "Unequal character lengths \\(20/2\\)" }
  p1 => c(1:) ! { dg-error "Unequal character lengths \\(20/4\\)" }
  p1 => c(:4) ! { dg-error "Unequal character lengths \\(20/4\\)" }
end