public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "valeryweber at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/55282] New: openmp directive and classes
Date: Mon, 12 Nov 2012 10:20:00 -0000	[thread overview]
Message-ID: <bug-55282-4@http.gcc.gnu.org/bugzilla/> (raw)


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


             reply	other threads:[~2012-11-12 10:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 10:20 valeryweber at hotmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55282-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).