annotate gcc/testsuite/gfortran.dg/class_dummy_5.f90 @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! PR 54756: [OOP] [F08] Should reject CLASS, intent(out) in PURE procedures
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 module m
kono
parents:
diff changeset
8 type t
kono
parents:
diff changeset
9 contains
kono
parents:
diff changeset
10 final :: fnl ! impure finalizer
kono
parents:
diff changeset
11 end type t
kono
parents:
diff changeset
12 contains
kono
parents:
diff changeset
13 impure subroutine fnl(x)
kono
parents:
diff changeset
14 type(t) :: x
kono
parents:
diff changeset
15 print *,"finalized!"
kono
parents:
diff changeset
16 end subroutine
kono
parents:
diff changeset
17 end
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 program test
kono
parents:
diff changeset
20 use m
kono
parents:
diff changeset
21 type(t) :: x
kono
parents:
diff changeset
22 call foo(x)
kono
parents:
diff changeset
23 contains
kono
parents:
diff changeset
24 pure subroutine foo(x) ! { dg-error "may not be polymorphic" }
kono
parents:
diff changeset
25 ! pure subroutine would call impure finalizer
kono
parents:
diff changeset
26 class(t), intent(out) :: x
kono
parents:
diff changeset
27 end subroutine
kono
parents:
diff changeset
28 end