* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git] / gcc / testsuite / gfortran.dg / class_dummy_5.f90
blob78fc4f8c622507118963b65929341e2249f226f2
1 ! { dg-do compile }
3 ! PR 54756: [OOP] [F08] Should reject CLASS, intent(out) in PURE procedures
5 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
7 module m
8 type t
9 contains
10 final :: fnl ! impure finalizer
11 end type t
12 contains
13 impure subroutine fnl(x)
14 type(t) :: x
15 print *,"finalized!"
16 end subroutine
17 end
19 program test
20 use m
21 type(t) :: x
22 call foo(x)
23 contains
24 pure subroutine foo(x) ! { dg-error "may not be polymorphic" }
25 ! pure subroutine would call impure finalizer
26 class(t), intent(out) :: x
27 end subroutine
28 end