public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32876]  New: Wrongly accepts private items in public NAMELISTs
@ 2007-07-24 13:43 burnus at gcc dot gnu dot org
  2007-07-25  5:13 ` [Bug fortran/32876] " pault at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-24 13:43 UTC (permalink / raw)
  To: gcc-bugs

integer,private :: i
  namelist /c/ i
is correctly diagnosed as invalid: "PRIVATE symbol '%s' cannot be member of
PUBLIC namelist at %L"; however, for derived types this fails. Note that NAG
f95 only gives an error for "B" and not for "A":

Error: mod.f90, line 14: PUBLIC NAMELIST /B/ has member T2 with PRIVATE
components

(I don't know in how far "A" is valid or what happens if T1 or T2 contains
other type(*)s which are private.)

module x
  type tp1
    integer, private :: i
  end type tp1
  type tp2
    private
    integer :: i
  end type tp2
  type(tp1) :: t1
  type(tp2) :: t2
  integer :: j1,j2
  namelist /a/ t1,j
  namelist /b/ t2,j
end module x


-- 
           Summary: Wrongly accepts private items in public NAMELISTs
           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: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/32876] Wrongly accepts private items in public NAMELISTs
  2007-07-24 13:43 [Bug fortran/32876] New: Wrongly accepts private items in public NAMELISTs burnus at gcc dot gnu dot org
@ 2007-07-25  5:13 ` pault at gcc dot gnu dot org
  2007-07-25 17:57 ` dfranke at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-07-25  5:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2007-07-25 05:13 -------
5.4 Namelist

Constraint: If a namelist-group-name has the PUBLIC attribute, no item in the
namelist-group-object-list shall have the PRIVATE attribute or have private
components.

I think that, by extension, components with private components must be illegal
too.

Confirmed

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-07-25 05:13:12
               date|                            |


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


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

* [Bug fortran/32876] Wrongly accepts private items in public NAMELISTs
  2007-07-24 13:43 [Bug fortran/32876] New: Wrongly accepts private items in public NAMELISTs burnus at gcc dot gnu dot org
  2007-07-25  5:13 ` [Bug fortran/32876] " pault at gcc dot gnu dot org
@ 2007-07-25 17:57 ` dfranke at gcc dot gnu dot org
  2007-07-25 18:09 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-25 17:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dfranke at gcc dot gnu dot org  2007-07-25 17:57 -------
Paul, thanks for the tip.
I'll have a look.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |dfranke at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-07-25 05:13:12         |2007-07-25 17:57:14
               date|                            |


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


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

* [Bug fortran/32876] Wrongly accepts private items in public NAMELISTs
  2007-07-24 13:43 [Bug fortran/32876] New: Wrongly accepts private items in public NAMELISTs burnus at gcc dot gnu dot org
  2007-07-25  5:13 ` [Bug fortran/32876] " pault at gcc dot gnu dot org
  2007-07-25 17:57 ` dfranke at gcc dot gnu dot org
@ 2007-07-25 18:09 ` burnus at gcc dot gnu dot org
  2007-07-28  8:51 ` dfranke at gcc dot gnu dot org
  2007-07-28  8:54 ` dfranke at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-25 18:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2007-07-25 18:09 -------
> I think that, by extension, components with private components must be illegal
> too.

Which means checking over several levels. For the following program, g95 gives
an error. (NAG f95, ifort don't.)

> I'll have a look.
Thanks, Daniel.

module x
  type tp3
    private
    integer :: i
  end type tp3
  type tp2
    type(tp3) :: t
  end type tp2
  type tp1
    integer :: i
    type(tp2) :: t
  end type tp1
  type(tp1) :: t1
  integer :: j
  namelist /a/ t1,j
end module x


-- 


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


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

* [Bug fortran/32876] Wrongly accepts private items in public NAMELISTs
  2007-07-24 13:43 [Bug fortran/32876] New: Wrongly accepts private items in public NAMELISTs burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-07-25 18:09 ` burnus at gcc dot gnu dot org
@ 2007-07-28  8:51 ` dfranke at gcc dot gnu dot org
  2007-07-28  8:54 ` dfranke at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-28  8:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dfranke at gcc dot gnu dot org  2007-07-28 08:51 -------
Subject: Bug 32876

Author: dfranke
Date: Sat Jul 28 08:51:06 2007
New Revision: 127014

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127014
Log:
gcc/fortran:
2007-07-28  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/31818
        PR fortran/32876
        PR fortran/32905
        * gfortran.h (symbol_attribute): Added bits for pointer_comp,
private_comp.
        * parse.c (parse_derived): Set pointer_comp/private_comp bits if the
derived
        type ultimately contains pointer components or private components.
        * module.c (ab_attribute): New values AB_POINTER_COMP, AB_PRIVATE_COMP.
        (attr_bits): Added names for new ab_attributes.
        (mio_symbol_attribute): Save/restore new attribute bits in modules.
        * match.c (gfc_match_namelist): Removed check for namelist objects of
assumed
        shape.
        * resolve.c (resolve_fl_namelist): Added check for pointer or private
        components in nested types. Added check for namelist objects of assumed
        shape.

gcc/testsuite:
2007-07-28  Daniel Franke  <franke.daniel@gmail.com>

        * gfortran.dg/namelist_5.f90: Adjusted error message.
        * gfortran.dg/assumed_shape_nml.f90: Renamed to ...
        * gfortran.dg/namelist_31.f90: ... this. Removed dg-warning directive.
        * gfortran.dg/assumed_size_nml.f90: Renamed to ...
        * gfortran.dg/namelist_32.f90: ... this.

        PR fortran/32876
        * gfortran.dg/namelist_33.f90: New test.

        PR fortran/32905
        * gfortran.dg/namelist_34.f90: New test.

        PR fortran/31818
        * gfortran.dg/namelist_35.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/namelist_31.f90
      - copied, changed from r126930,
trunk/gcc/testsuite/gfortran.dg/assumed_shape_nml.f90
    trunk/gcc/testsuite/gfortran.dg/namelist_32.f90
      - copied unchanged from r126930,
trunk/gcc/testsuite/gfortran.dg/assumed_size_nml.f90
    trunk/gcc/testsuite/gfortran.dg/namelist_33.f90
    trunk/gcc/testsuite/gfortran.dg/namelist_34.f90
    trunk/gcc/testsuite/gfortran.dg/namelist_35.f90
Removed:
    trunk/gcc/testsuite/gfortran.dg/assumed_shape_nml.f90
    trunk/gcc/testsuite/gfortran.dg/assumed_size_nml.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/module.c
    trunk/gcc/fortran/parse.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/namelist_5.f90


-- 


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


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

* [Bug fortran/32876] Wrongly accepts private items in public NAMELISTs
  2007-07-24 13:43 [Bug fortran/32876] New: Wrongly accepts private items in public NAMELISTs burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-07-28  8:51 ` dfranke at gcc dot gnu dot org
@ 2007-07-28  8:54 ` dfranke at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-28  8:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dfranke at gcc dot gnu dot org  2007-07-28 08:53 -------
Fixed in trunk. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2007-
                   |                            |07/msg02016.html
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-07-28  8:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-24 13:43 [Bug fortran/32876] New: Wrongly accepts private items in public NAMELISTs burnus at gcc dot gnu dot org
2007-07-25  5:13 ` [Bug fortran/32876] " pault at gcc dot gnu dot org
2007-07-25 17:57 ` dfranke at gcc dot gnu dot org
2007-07-25 18:09 ` burnus at gcc dot gnu dot org
2007-07-28  8:51 ` dfranke at gcc dot gnu dot org
2007-07-28  8:54 ` dfranke 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).