c++: Implement __is_nothrow_invocable built-in trait
[official-gcc.git] / gcc / testsuite / gfortran.dg / class_65.f90
blobb6ec3baa92975c73655aa19f3386f48e559c139c
1 ! { dg-do run }
3 ! Test the fix for PR81447 in which a vtable was not being created
4 ! in the module 'm' so that x->vptr in 's' did not have the same
5 ! value as that in 'p'.
7 ! Contributed by Mat Cross <mathewc@nag.co.uk>
9 Module m
10 Type :: t
11 integer :: i
12 End Type
13 End Module
15 Program p
16 Use m
17 Class (t), Allocatable :: x
18 Interface
19 Subroutine s(x)
20 Use m
21 Class (t), Allocatable :: x
22 End Subroutine
23 End Interface
24 Call s(x)
25 Select Type (x)
26 Type Is (t)
27 Continue
28 Class Is (t)
29 STOP 1
30 Class Default
31 STOP 2
32 End Select
33 ! Print *, 'ok'
34 End Program
36 Subroutine s(x)
37 Use m, Only: t
38 Implicit None
39 Class (t), Allocatable :: x
40 Allocate (t :: x)
41 End Subroutine