http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55282

             Bug #: 55282
           Summary: openmp directive and classes
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: valerywe...@hotmail.com


Dear All

The following code doesnt compile at all with the lattest gfortran. 
The problem seems to be in the class definition of the variable "this" 
(works fine while declared as type).

gcc version 4.8.0 20121112 (experimental) (GCC) 

>>>>>
module mod
  use omp_lib
  type :: my_t
     integer :: i
  end type my_t
contains
  subroutine init( this )
    class( my_t ) :: this
!    type( my_t ) :: this
    write(*,*) 'init thread=',omp_get_thread_num()
    this%i=2
  end subroutine init
end module mod
program prog
  use mod
  type( my_t ) :: a
!$omp parallel default( none ) & 
!$omp          private( a ) & 
!$omp          num_threads( 4 )
  call init(a)
!$omp end parallel
end program prog
------
gfortran-trunk prog.f90 -fopenmp
bug.f90: In function ‘prog’:
bug.f90:21:0: error: ‘__vtab_mod_My_t’ not specified in enclosing parallel
   call init(a)
 ^
bug.f90:20:0: error: enclosing parallel
 !$omp          num_threads( 4 )
<<<<<<

Thanks
Valery

Reply via email to