3 ! Checks that PRIVATE/PUBLIC not allowed in submodules. Also, IMPORT
4 ! is not allowed in a module procedure interface body.
6 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
11 character(len=16), private :: byebye = "adieu, world! "
14 ! This interface is required to trigger the output of an .smod file.
15 ! See http://j3-fortran.org/doc/meeting/207/15-209.txt
17 integer module function trigger_smod ()
23 module foo_interface_brother
27 module subroutine array3(this, that)
28 import ! { dg-error "not permitted in a module procedure interface body" }
29 type(foo), intent(in), dimension(:) :: this
30 type(foo), intent(inOUT), allocatable, dimension(:) :: that
35 SUBMODULE (foo_interface) foo_interface_son
36 private ! { dg-error "PRIVATE statement" }
37 public ! { dg-error "PUBLIC statement" }
38 integer, public :: i ! { dg-error "PUBLIC attribute" }
39 integer, private :: j ! { dg-error "PRIVATE attribute" }
41 private ! { dg-error "PRIVATE statement" }
42 public ! { dg-error "PUBLIC statement" }
43 integer, private :: i ! { dg-error "PRIVATE attribute" }
44 integer, public :: j ! { dg-error "PUBLIC attribute" }
48 end submodule foo_interface_son
50 SUBMODULE (foo_interface) foo_interface_daughter
53 subroutine foobar (arg)
55 arg%byebye = "hello, world! " ! Access to private component is OK
57 end SUBMODULE foo_interface_daughter