public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/23843] New: Access restrictions on derived types in modules too strict.
@ 2005-09-12 21:21 zeekec at mad dot scientist dot com
  2005-09-12 21:54 ` [Bug fortran/23843] " kargl at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: zeekec at mad dot scientist dot com @ 2005-09-12 21:21 UTC (permalink / raw)
  To: gcc-bugs

The following code:

---------------------------
module gfortran2

    type tp
        private
        integer :: i
    end type
contains
    subroutine inittp(X)
        type(tp), intent(inout) :: X
        X%i = 256
    end subroutine inittp

    subroutine test(x)
        type(tp), intent(in) :: x

        write(*,*) x%i
        write(*,*) x
    end subroutine test
end module

program prog
    use gfortran2
    implicit none
    type(tp) :: Y

    call inittp(Y)
    call test(Y)
end program prog
--------------------------

produces the following error:

--------------------------
> gfortran-CVS gfortran2.F95  -Wall
 In file gfortran2.F95:17

        write(*,*) x
                   1
Error: Data transfer element at (1) cannot have PRIVATE components
 In file gfortran2.F95:22

    use gfortran2
                1
Fatal Error: Can't open module file 'gfortran2.mod' for reading at (1): No such
file or directory
---------------------------

The second error is a direct result of the first.  The code is accepted without
error or warning by Intel, NAG, and XLF compilers, even with -std95 and -warn all.

Thanks,
Erik

P.S.  I'm not a standards lawyer, so the above code may not be valid, but it
does work on the other compilers.

P.P.S.  Thanks for all the great work on this project.

-- 
           Summary: Access restrictions on derived types in modules too
                    strict.
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zeekec at mad dot scientist dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug fortran/23843] Access restrictions on derived types in modules too strict.
  2005-09-12 21:21 [Bug fortran/23843] New: Access restrictions on derived types in modules too strict zeekec at mad dot scientist dot com
@ 2005-09-12 21:54 ` kargl at gcc dot gnu dot org
  2005-09-21 20:36 ` erik dot edelmann at iki dot fi
  2005-09-22 21:52 ` cvs-commit at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu dot org @ 2005-09-12 21:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kargl at gcc dot gnu dot org  2005-09-12 21:54 -------
Confirmed.  Lahey's web-based checker also accepts the code.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-12 21:54:16
               date|                            |


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


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

* [Bug fortran/23843] Access restrictions on derived types in modules too strict.
  2005-09-12 21:21 [Bug fortran/23843] New: Access restrictions on derived types in modules too strict zeekec at mad dot scientist dot com
  2005-09-12 21:54 ` [Bug fortran/23843] " kargl at gcc dot gnu dot org
@ 2005-09-21 20:36 ` erik dot edelmann at iki dot fi
  2005-09-22 21:52 ` cvs-commit at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: erik dot edelmann at iki dot fi @ 2005-09-21 20:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From erik dot edelmann at iki dot fi  2005-09-21 20:36 -------
Patch posted to the mailing list here:
http://gcc.gnu.org/ml/gcc-patches/2005-09/msg01359.html

-- 


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


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

* [Bug fortran/23843] Access restrictions on derived types in modules too strict.
  2005-09-12 21:21 [Bug fortran/23843] New: Access restrictions on derived types in modules too strict zeekec at mad dot scientist dot com
  2005-09-12 21:54 ` [Bug fortran/23843] " kargl at gcc dot gnu dot org
  2005-09-21 20:36 ` erik dot edelmann at iki dot fi
@ 2005-09-22 21:52 ` cvs-commit at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-22 21:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-22 21:52 -------
Subject: Bug 23843

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2005-09-22 21:52:09

Modified files:
	gcc/fortran    : ChangeLog resolve.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: der_io_2.f90 der_io_3.f90 

Log message:
	fortran/
	2005-09-22  Erik Edelmann  <erik.edelmann@iki.fi>
	
	PR fortran/23843
	* resolve.c (derived_inaccessible): New function.
	(resolve_transfer): Use it to check for private
	components.
	testsuite/
	2005-09-22  Erik Edelmann  <erik.edelmann@iki.fi>
	Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
	
	PR fortran/23843
	* gfortran.dg/der_io_2.f90, gfortran.dg/der_io_3.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.565&r2=1.566
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.54&r2=1.55
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6098&r2=1.6099
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/der_io_2.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/der_io_3.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug fortran/23843] Access restrictions on derived types in modules too strict.
       [not found] <bug-23843-8928@http.gcc.gnu.org/bugzilla/>
  2005-10-23 21:07 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-23 21:08 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-23 21:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-10-23 21:08 -------
Fixed in 4.0.3.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.3


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


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

* [Bug fortran/23843] Access restrictions on derived types in modules too strict.
       [not found] <bug-23843-8928@http.gcc.gnu.org/bugzilla/>
@ 2005-10-23 21:07 ` cvs-commit at gcc dot gnu dot org
  2005-10-23 21:08 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-23 21:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from cvs-commit at gcc dot gnu dot org  2005-10-23 21:07 -------
Subject: Bug 23843

CVSROOT:        /cvs/gcc
Module name:    gcc
Branch:         gcc-4_0-branch
Changes by:     eedelman@gcc.gnu.org    2005-10-23 21:07:10

Modified files:
        gcc/fortran    : ChangeLog resolve.c 
        gcc/testsuite  : ChangeLog 
Added files:
        gcc/testsuite/gfortran.dg: der_io_2.f90 der_io_3.f90 

Log message:
        fortran/
        2005-10-23  Erik Edelmann  <erik.edelmann@iki.fi>

        PR fortran/23843
        * resolve.c (derived_inaccessible): New function.
        (resolve_transfer): Use it to check for private
        components.

        testsuite/
        2005-10-23  Erik Edelmann  <erik.edelmann@iki.fi>
        Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>

        PR fortran/23843
        * gfortran.dg/der_io_2.f90, gfortran.dg/der_io_3.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.137&r2=1.335.2.138
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.34.2.21&r2=1.34.2.22
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.484&r2=1.5084.2.485
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/der_io_2.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.16.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/der_io_3.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.16.1


-- 


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


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

end of thread, other threads:[~2005-10-23 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-12 21:21 [Bug fortran/23843] New: Access restrictions on derived types in modules too strict zeekec at mad dot scientist dot com
2005-09-12 21:54 ` [Bug fortran/23843] " kargl at gcc dot gnu dot org
2005-09-21 20:36 ` erik dot edelmann at iki dot fi
2005-09-22 21:52 ` cvs-commit at gcc dot gnu dot org
     [not found] <bug-23843-8928@http.gcc.gnu.org/bugzilla/>
2005-10-23 21:07 ` cvs-commit at gcc dot gnu dot org
2005-10-23 21:08 ` pinskia at gcc dot gnu dot 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).