OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [class_dummy_3.f03] - Blame information for rev 715

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
!
3
! PR 46161: [OOP] Invalid: Passing non-polymorphic to allocatable polymorphic dummy
4
!
5
! Contributed by Janus Weil 
6
 
7
  implicit none
8
 
9
  type :: base
10
  end type
11
 
12
  type, extends(base) :: ext
13
  end type
14
 
15
  type(base), allocatable :: a
16
  class(base), pointer :: b
17
  class(ext), allocatable :: c
18
 
19
  call test(a)  ! { dg-error "must be polymorphic" }
20
  call test(b)  ! { dg-error "must be ALLOCATABLE" }
21
  call test(c)  ! { dg-error "must have the same declared type" }
22
 
23
contains
24
 
25
  subroutine test(arg)
26
    implicit none
27
    class(base), allocatable :: arg
28
  end subroutine
29
 
30
end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.