repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fix pr/45972
[official-gcc.git]
/
gcc
/
testsuite
/
gfortran.dg
/
class_5.f03
blob
087d745aec7f9911e1dbe7305c184db190a1cbec
1
! { dg-do compile }
2
!
3
! PR 41719: [OOP] invalid: Intrinsic assignment involving polymorphic variables
4
!
5
! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
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