public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32460]  New: structure constructor not allowed if a USEd type has private components
@ 2007-06-22  9:07 dfranke at gcc dot gnu dot org
  2007-06-23 14:55 ` [Bug fortran/32460] " burnus at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-06-22  9:07 UTC (permalink / raw)
  To: gcc-bugs

gfortran accepts this code while INTEL and SUN compilers reject it:

$> cat private.f90
MODULE foomod
TYPE :: footype
  PRIVATE
  integer :: dummy
END TYPE
END MODULE

PROGRAM foo_test
  USE foomod
  TYPE(footype) :: foo
  foo = footype(1)
END


$> sunf95 -w4 private.f90

  foo = footype(1)
        ^
"private.f90", Line = 11, Column = 9: ERROR: Derived type "FOOTYPE" has private
components, therefore a structure constructor must not be defined for this
type.

$> ifort -warn all private.f90
fortcom: Error: private.f90, line 11: The type of this structure constructor is
use associated with the PRIVATE fields attribute   [FOOTYPE]
  foo = footype(1)
--------^


-- 
           Summary: structure constructor not allowed if a USEd type has
                    private components
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dfranke at gcc dot gnu dot org


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


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

* [Bug fortran/32460] structure constructor not allowed if a USEd type has private components
  2007-06-22  9:07 [Bug fortran/32460] New: structure constructor not allowed if a USEd type has private components dfranke at gcc dot gnu dot org
@ 2007-06-23 14:55 ` burnus at gcc dot gnu dot org
  2007-06-23 16:10 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-06-23 14:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2007-06-23 14:55 -------
Mine. Note that
  type :: bar
    integer, private :: x
  end type
has the same problem, esp.  "b%x = 5" is also possible.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |burnus at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-23 14:55:06
               date|                            |


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


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

* [Bug fortran/32460] structure constructor not allowed if a USEd type has private components
  2007-06-22  9:07 [Bug fortran/32460] New: structure constructor not allowed if a USEd type has private components dfranke at gcc dot gnu dot org
  2007-06-23 14:55 ` [Bug fortran/32460] " burnus at gcc dot gnu dot org
@ 2007-06-23 16:10 ` patchapp at dberlin dot org
  2007-06-24 16:19 ` burnus at gcc dot gnu dot org
  2007-06-24 16:20 ` burnus at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: patchapp at dberlin dot org @ 2007-06-23 16:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from patchapp at dberlin dot org  2007-06-23 16:10 -------
Subject: Bug number PR 32460

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01702.html


-- 


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


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

* [Bug fortran/32460] structure constructor not allowed if a USEd type has private components
  2007-06-22  9:07 [Bug fortran/32460] New: structure constructor not allowed if a USEd type has private components dfranke at gcc dot gnu dot org
  2007-06-23 14:55 ` [Bug fortran/32460] " burnus at gcc dot gnu dot org
  2007-06-23 16:10 ` patchapp at dberlin dot org
@ 2007-06-24 16:19 ` burnus at gcc dot gnu dot org
  2007-06-24 16:20 ` burnus at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-06-24 16:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2007-06-24 16:19 -------
Subject: Bug 32460

Author: burnus
Date: Sun Jun 24 16:19:11 2007
New Revision: 125984

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125984
Log:
2007-06-24  Tobias Burnus  <burnus@net-de>

        PR fortran/32460
        * interface.c (gfc_compare_derived_types): Add access check.
        * symbol.c (gfc_find_component): Ditto.
        (gfc_set_component_attr,gfc_get_component_attr) Copy access state.
        * dump-parse-tree.c (gfc_show_components): Dump access state.
        * gfortran.h (struct gfc_component): Add gfc_access.
        * module.c (mio_component): Add access state.
        * (gfc_match_structure_constructor): Check for private access state.

2007-06-24  Tobias Burnus  <burnus@net-de>

        PR fortran/32460
        * gfortran.dg/private_type_6.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/private_type_6.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/dump-parse-tree.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/interface.c
    trunk/gcc/fortran/module.c
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/32460] structure constructor not allowed if a USEd type has private components
  2007-06-22  9:07 [Bug fortran/32460] New: structure constructor not allowed if a USEd type has private components dfranke at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-06-24 16:19 ` burnus at gcc dot gnu dot org
@ 2007-06-24 16:20 ` burnus at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-06-24 16:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2007-06-24 16:20 -------
Fixed in 4.3.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-06-24 16:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-22  9:07 [Bug fortran/32460] New: structure constructor not allowed if a USEd type has private components dfranke at gcc dot gnu dot org
2007-06-23 14:55 ` [Bug fortran/32460] " burnus at gcc dot gnu dot org
2007-06-23 16:10 ` patchapp at dberlin dot org
2007-06-24 16:19 ` burnus at gcc dot gnu dot org
2007-06-24 16:20 ` burnus 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).