2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / interface_abstract_4.f90
blob50f101577e6785669324a697625b7063ec518359
1 ! { dg-do compile }
3 ! PR 41873: Bogus Error: ABSTRACT INTERFACE must not be referenced...
5 ! Contributed by Harald Anlauf <anlauf@gmx.de>
7 implicit none
9 type, abstract :: abstype
10 contains
11 procedure(f), nopass, deferred :: f_bound
12 procedure(s), nopass, deferred :: s_bound
13 end type
15 abstract interface
16 real function f ()
17 end function
18 end interface
20 abstract interface
21 subroutine s
22 end subroutine
23 end interface
25 contains
27 subroutine cg (c)
28 class(abstype) :: c
29 print *, f() ! { dg-error "must not be referenced" }
30 call s ! { dg-error "must not be referenced" }
31 print *, c%f_bound ()
32 call c%s_bound ()
33 end subroutine
35 end