File: pr114535d.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (42 lines) | stat: -rw-r--r-- 1,071 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
! { dg-do compile }
! { dg-compile-aux-modules "pr114535iv.f90" }
! Contributed by Andrew Benson  <abensonca@gcc.gnu.org>
!
module d
  implicit none
contains
  function en() result(dd)
    use :: iv
    implicit none
    type(vs) :: dd
    dd%i = 1
  end function en
end module d

! Delete line 1 and all brands complain that 'vs' is an undefined type.
! Delete lines 1 and line 2 recreates the original problem.
module ni
  implicit none
contains
  subroutine iss1()
!    use :: iv                                        ! line 1
    use :: d
    implicit none
!    type(vs) :: ans; ans = en();                     ! line 2
  end subroutine iss1
  subroutine iss2()
    use :: d
    implicit none
  end subroutine iss2
end module ni ! Used to give an ICE: in gfc_trans_call, at fortran/trans-stmt.cc:400

  use ni
  use iv
  type(vs) :: x
  call iss1()
  call iss1()
  if ((ctr .eq. 0) .or. (ctr .ne. 6)) stop 1  ! Depends whether lines 1 & 2 are present
  call iss2()
  x = vs(42)
  if ((ctr .eq. 1) .or. (ctr .ne. 7)) stop 2  ! Make sure destructor available here
end