public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vivekrao4 at yahoo dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/104097] New: parameterized derived type (PDT) with type-bound procedure Date: Tue, 18 Jan 2022 14:57:11 +0000 [thread overview] Message-ID: <bug-104097-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104097 Bug ID: 104097 Summary: parameterized derived type (PDT) with type-bound procedure Product: gcc Version: og11 (devel/omp/gcc-11) Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: vivekrao4 at yahoo dot com Target Milestone: --- The code module m implicit none type :: t(n) integer, len :: n = 0 integer :: vec(n) contains procedure :: disp end type t contains subroutine disp(dt) class(t(n=*)), intent(in) :: dt print*,dt%vec end subroutine disp end module m ! program main use m implicit none integer, parameter :: n = 3 type(t(n)) :: x x%vec = [1,4,9] print*,x%vec call x%disp() end program main compiles and runs with Intel Fortran, giving output 1 4 9 1 4 9 but with gfortran I get (base) /mnt/c/fortran/test$ gfortran-11 --version GNU Fortran (Ubuntu 11.1.0-1ubuntu1~20.04) 11.1.0 <snip> (base) /mnt/c/fortran/test$ gfortran-11 pdt_tbp.f90 pdt_tbp.f90:7:13: 7 | procedure :: disp | 1 Error: Argument ‘dt’ of ‘disp’ with PASS(dt) at (1) must be of the derived-type ‘t’ pdt_tbp.f90:17:5: 17 | use m | 1 Fatal Error: Cannot open module file ‘m.mod’ for reading at (1): No such file or directory compilation terminated.
next reply other threads:[~2022-01-18 14:57 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-18 14:57 vivekrao4 at yahoo dot com [this message] 2023-06-30 8:45 ` [Bug fortran/104097] " pault 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-104097-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: linkBe 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).