File: resolve31.f90

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (109 lines) | stat: -rw-r--r-- 2,845 bytes parent folder | download | duplicates (2)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
! C735 If EXTENDS appears, SEQUENCE shall not appear.
! C738 The same private-or-sequence shall not appear more than once in a
! given derived-type-def .
!
! C740 If SEQUENCE appears,
!  the type shall have at least one component,
!  each data component shall be declared to be of an intrinsic type or of a sequence type,
!  the derived type shall not have any type parameter,
!  and a type-bound-procedure-part shall not appear.
subroutine s1
  integer :: t0
  !ERROR: 't0' is not a derived type
  type(t0) :: x
  type :: t1
  end type
  type, extends(t1) :: t2
  end type
  !ERROR: Derived type 't3' not found
  type, extends(t3) :: t4
  end type
  !ERROR: 't0' is not a derived type
  type, extends(t0) :: t5
  end type
end subroutine

module m1
  type t0
  end type
end
module m2
  type t
  end type
end
module m3
  type t0
  end type
end
subroutine s2
  use m1
  use m2, t0 => t
  use m3
  !ERROR: Reference to 't0' is ambiguous
  type, extends(t0) :: t1
  end type
end subroutine

module m4
  type :: t1
    private
    sequence
    !WARNING: PRIVATE should not appear more than once in derived type components
    private
    !WARNING: SEQUENCE should not appear more than once in derived type components
    sequence
    real :: t1Field
  end type
  type :: t1a
  end type
  !ERROR: A sequence type may not have the EXTENDS attribute
  type, extends(t1a) :: t2
    sequence
    integer i
  end type
  type :: t3
    sequence
    integer i
  !ERROR: A sequence type may not have a CONTAINS statement
  contains
  end type
  !ERROR: A sequence type must have at least one component
  type :: emptyType
    sequence
  end type emptyType
  type :: plainType
    real :: plainField
  end type plainType
  type :: sequenceType
    sequence
    real :: sequenceField
  end type sequenceType
  type :: testType
    sequence
    !ERROR: A sequence type data component must either be of an intrinsic type or a derived sequence type
    class(*), allocatable :: typeStarField
    !ERROR: A sequence type data component must either be of an intrinsic type or a derived sequence type
    type(plainType) :: testField1
    !WARNING: A sequence type data component that is a pointer to a non-sequence type is not standard
    type(plainType), pointer :: testField1p
    type(sequenceType) :: testField2
    procedure(real), pointer, nopass :: procField
  end type testType
  !ERROR: A sequence type may not have type parameters
  type :: paramType(param)
    integer, kind :: param
    sequence
    real :: paramField
  end type paramType
contains
  subroutine s3
    type :: t1
      !ERROR: PRIVATE is only allowed in a derived type that is in a module
      private
    contains
      !ERROR: PRIVATE is only allowed in a derived type that is in a module
      private
    end type
  end
end