fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / char_pointer_assign_2.f90
blobc67bbb4af898a3b6c97c97fd1adf136121a17ef2
1 ! { dg-do compile }
2 ! Tests the fix for PRs20895 and 25030, where pointer assignments
3 ! of different length characters were accepted.
4 character(4), target :: ch1(2)
5 character(4), pointer :: ch2(:)
6 character(5), pointer :: ch3(:)
8 ch2 => ch1 ! Check correct is OK
9 ch3 => ch1 ! { dg-error "Unequal character lengths \\(5/4\\)" }
11 end