fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / host_assoc_types_1.f90
blob53c968410e0744d6724a57afd1e9582443a2eab5
1 ! { dg-do compile }
2 ! Tests the fix for PR29232, in which the invalid code below was not
3 ! diagnosed.
5 ! Contributed by Tobias Burnus <tobias.burnus@physik.fu-berlin.de>
7 MODULE test
8 TYPE vertex
9 INTEGER :: k
10 END TYPE vertex
11 CONTAINS
12 SUBROUTINE S1()
13 TYPE(vertex) :: a ! { dg-error "cannot be host associated" }
14 vertex : DO i=1,2 ! { dg-error "incompatible object of the same name" }
15 ENDDO vertex
16 END SUBROUTINE
17 END MODULE test
18 ! { dg-final { cleanup-modules "test" } }