1! { dg-do compile }
2! { dg-options "" }
3!
4! Support Fortran 2015's IMPLICIT NONE with spec list
5!
6
7subroutine sub1
8implicit none (type)
9call test()
10i = 1 ! { dg-error "Symbol 'i' at .1. has no IMPLICIT type" }
11end subroutine sub1
12
13subroutine sub2
14implicit none ( external )
15call foo() ! { dg-error "Procedure 'foo' called at .1. is not explicitly declared" }
16i = 2
17end subroutine sub2
18
19subroutine sub3
20implicit none ( external, type, external, type )
21call foo() ! { dg-error "Procedure 'foo' called at .1. is not explicitly declared" }
22i = 3 ! { dg-error "Symbol 'i' at .1. has no IMPLICIT type" }
23end subroutine sub3
24
25subroutine sub4
26implicit none ( external ,type)
27external foo
28call foo()
29i = 4 ! { dg-error "Symbol 'i' at .1. has no IMPLICIT type" }
30end subroutine sub4
31
32subroutine sub5  ! OK
33implicit integer(a-z)
34implicit none ( external )
35procedure() :: foo
36call foo()
37i = 5
38end subroutine sub5
39
40subroutine sub6  ! OK
41implicit none ( external )
42implicit integer(a-z)
43procedure() :: foo
44call foo()
45i = 5
46end subroutine sub6
47
48subroutine sub7
49implicit none ( external )
50implicit none ! { dg-error "Duplicate IMPLICIT NONE statement" }
51end subroutine sub7
52
53subroutine sub8
54implicit none
55implicit none ( type ) ! { dg-error "Duplicate IMPLICIT NONE statement" }
56end subroutine sub8
57
58subroutine sub9
59implicit none ( external, type )
60implicit integer(a-z) ! { dg-error "IMPLICIT statement at .1. following an IMPLICIT NONE .type. statement" }
61procedure() :: foo
62call foo()
63end subroutine sub9
64
65subroutine sub10
66implicit integer(a-z)
67implicit none ( external, type ) ! { dg-error "IMPLICIT NONE .type. statement at .1. following an IMPLICIT statement" }
68procedure() :: foo
69call foo()
70end subroutine sub10
71