title: fortran extended types over different modules
body: <p>With extended types in Fortran should a private component by visible to a type extension in a different module.</p>
  
  <p>With both gcc4.7 and ifort the following code results in a error since bName is in both the initial type and the extension. But since it's private, it isn't accesible in the extension in a different module, i.e., if you comment out bName in the bar_type you will get an error that it's private.</p>
  
  <pre><code>module foo
    type :: foo_type
      character(256),private :: bName = "foo"
    contains
      procedure :: pName =&gt; pName
    end type
  contains
    subroutine pName(this)
      class(foo_type), intent(in) :: this
      print*,trim(this%bName)
    end subroutine
  end module
  
  module bar
    use foo, only : foo_type
    type,extends(foo_type) :: bar_type
      character(256),private :: bName = "bar"
    contains
      procedure :: pName =&gt; pName
    end type
  contains
  
    subroutine pName(this)
      class(bar_type), intent(in) :: this
      print*,this%bName
    end subroutine
  end module
  
  
  program test
    use foo, only : foo_type
    use bar, only : bar_type
    type(foo_type) :: foo_inst
    type(bar_type) :: bar_inst
  
    call foo_inst%pName()
    call bar_inst%pName()
  end program
  </code></pre>
  
  <p>If bar_type was contained in the same module as foo_type, then bName would be accessible from bar_type, i.e., the following code will compile</p>
  
  <pre><code>module foo
    type :: foo_type
      character(256),private :: bName = "foo"
    contains
      procedure :: pName =&gt; pName
    end type
  
    type, extends(foo_type) :: baz_type
    contains
      procedure :: pName =&gt; pName_baz
    end type
  contains
    subroutine pName_baz(this)
      class(baz_type), intent(in) :: this
      print*,trim(this%bName)
    end subroutine
  
    subroutine pName(this)
      class(foo_type), intent(in) :: this
      print*,trim(this%bName)
    end subroutine
  end module
  
  program test
    use foo, only : foo_type,baz_type
    type(foo_type) :: foo_inst
    type(baz_type) :: baz_inst
  
    call foo_inst%pName()
    call baz_inst%pName()
  end program
  </code></pre>
  
  <p>Been having a hard time parsing the standards to know what should happen in the first example.</p>