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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
!
3
! PR 41719: [OOP] invalid: Intrinsic assignment involving polymorphic variables
4
!
5
! Contributed by Tobias Burnus 
6
 
7
 implicit none
8
 
9
 type t1
10
   integer :: a
11
 end type
12
 
13
 type, extends(t1) :: t2
14
   integer :: b
15
 end type
16
 
17
 class(t1),pointer :: cp
18
 type(t2) :: x
19
 
20
 x = t2(45,478)
21
 allocate(t2 :: cp)
22
 
23
 cp = x   ! { dg-error "Variable must not be polymorphic" }
24
 
25
 select type (cp)
26
 type is (t2)
27
   print *, cp%a, cp%b
28
 end select
29
 
30
end
31
 

powered by: WebSVN 2.1.0

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