public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/55282] New: openmp directive and classes
@ 2012-11-12 10:20 valeryweber at hotmail dot com
  2012-11-12 14:36 ` [Bug fortran/55282] [OOP] " janus at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: valeryweber at hotmail dot com @ 2012-11-12 10:20 UTC (permalink / raw)
  To: gcc-bugs


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: unassigned@gcc.gnu.org
        ReportedBy: valeryweber@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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-03-17 17:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-12 10:20 [Bug fortran/55282] New: openmp directive and classes valeryweber at hotmail dot com
2012-11-12 14:36 ` [Bug fortran/55282] [OOP] " janus at gcc dot gnu.org
2012-11-12 14:47 ` janus at gcc dot gnu.org
2012-11-12 19:18 ` valeryweber at hotmail dot com
2012-11-12 20:02 ` kargl at gcc dot gnu.org
2012-11-13 10:44 ` burnus at gcc dot gnu.org
2012-11-13 16:57 ` valeryweber at hotmail dot com
2013-03-17 17:07 ` janus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).