My mental compiler failed me there, missed the parameter :: part. I.e.
module mod
implicit none
private
public :: const
integer, parameter :: const = 42
end module
This one applies to my example too:
C1807 A procedure defined in a submodule shall not have a binding label unless its interface is declared in the ancestor module.
But, the following example would satisfy the constraints, though it would be useless.
module mod
interface
module subroutine foo
end subroutine
end interface
contains
module procedure foo
end procedure
end module
submodule(mod) submod
contains
subroutine unreachable
end subroutine
end submodule