public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35395]  New: Invalid-accepted - public entity with private type should be diagnosed
@ 2008-02-27 18:28 w6ws at earthlink dot net
  2008-02-27 18:31 ` [Bug fortran/35395] " w6ws at earthlink dot net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: w6ws at earthlink dot net @ 2008-02-27 18:28 UTC (permalink / raw)
  To: gcc-bugs

The following test case should be diagnosed as an error.  This is because the
type definition (e.g, X_t) is private, but the entity defined with it (abc) is
public.

module xyzzy
  implicit none
  private

  type X_t
    real :: y
    real :: z
  end type

  private :: X_t

  type(X_t), parameter, public :: abc = X_t (12.34, 56.78)

end module 

This was observed with several versions of gfortran, including the 4.1.0 IA64
release, the 4.3.0 20081222 snapshot for x86 windows, and the 4.4.0 20080219
snapshot for x86_64 linux.

Both ifort 10.1 and SGI IRIX f90 correctly reject the code.  Interestingly,
Salford 5.10 (wrongly) accepts it.


-- 
           Summary: Invalid-accepted - public entity with private type
                    should be diagnosed
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: w6ws at earthlink dot net
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug fortran/35395] Invalid-accepted - public entity with private type should be diagnosed
  2008-02-27 18:28 [Bug fortran/35395] New: Invalid-accepted - public entity with private type should be diagnosed w6ws at earthlink dot net
@ 2008-02-27 18:31 ` w6ws at earthlink dot net
  2008-02-28 10:13 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: w6ws at earthlink dot net @ 2008-02-27 18:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from w6ws at earthlink dot net  2008-02-27 18:30 -------
Add keywords


-- 

w6ws at earthlink dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid


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


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

* [Bug fortran/35395] Invalid-accepted - public entity with private type should be diagnosed
  2008-02-27 18:28 [Bug fortran/35395] New: Invalid-accepted - public entity with private type should be diagnosed w6ws at earthlink dot net
  2008-02-27 18:31 ` [Bug fortran/35395] " w6ws at earthlink dot net
@ 2008-02-28 10:13 ` fxcoudert at gcc dot gnu dot org
  2008-03-23  9:38 ` pault at gcc dot gnu dot org
  2008-03-24 17:48 ` w6ws at earthlink dot net
  3 siblings, 0 replies; 5+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-02-28 10:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2008-02-28 10:12 -------
Confirmed on i686-apple-darwin8.10.1 with mainline.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|x86_64-unknown-linux-gnu    |
   GCC host triplet|x86_64-unknown-linux-gnu    |
 GCC target triplet|x86_64-unknown-linux-gnu    |
      Known to fail|                            |4.1.0 4.3.0 4.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-28 10:12:38
               date|                            |


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


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

* [Bug fortran/35395] Invalid-accepted - public entity with private type should be diagnosed
  2008-02-27 18:28 [Bug fortran/35395] New: Invalid-accepted - public entity with private type should be diagnosed w6ws at earthlink dot net
  2008-02-27 18:31 ` [Bug fortran/35395] " w6ws at earthlink dot net
  2008-02-28 10:13 ` fxcoudert at gcc dot gnu dot org
@ 2008-03-23  9:38 ` pault at gcc dot gnu dot org
  2008-03-24 17:48 ` w6ws at earthlink dot net
  3 siblings, 0 replies; 5+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-03-23  9:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2008-03-23 09:37 -------
(In reply to comment #1)
> Add keywords
> 

Walter,

This is permitted in F2003 so you have to apply the F95 standard to extract the
message out of gfortran:

[root@localhost svn]# /irun/bin/gfortran -std=f95 p*.f90
pr35395.f90:12.37:

  type(X_t), parameter, public :: abc = X_t (12.34, 56.78)
                                    1
Error: Fortran 2003: PUBLIC parameter 'abc' at (1) of PRIVATE derived type
'x_t'

See 4.5.1.1 of F2003.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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


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

* [Bug fortran/35395] Invalid-accepted - public entity with private type should be diagnosed
  2008-02-27 18:28 [Bug fortran/35395] New: Invalid-accepted - public entity with private type should be diagnosed w6ws at earthlink dot net
                   ` (2 preceding siblings ...)
  2008-03-23  9:38 ` pault at gcc dot gnu dot org
@ 2008-03-24 17:48 ` w6ws at earthlink dot net
  3 siblings, 0 replies; 5+ messages in thread
From: w6ws at earthlink dot net @ 2008-03-24 17:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from w6ws at earthlink dot net  2008-03-24 17:47 -------
Subject: Re:  Invalid-accepted - public entity with private
 type should be diagnosed

pault at gcc dot gnu dot org wrote:
> 
> This is permitted in F2003 so you have to apply the F95 standard to extract the
> message out of gfortran:

OK, I have researched this further, and concur with your response.
In fact, MR&C 95/2003 discusses this in section 18.14.  (I finally
bought a copy last week...)

So you may close the PR.  However it would also be nice if at least
the following web pages were updated to show that the feature is now
supported:

        http://gcc.gnu.org/wiki/GFortran#news
        http://gcc.gnu.org/wiki/Fortran2003
        http://gcc.gnu.org/wiki/Fortran2003Status

Thank you,

Walter


-- 


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


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

end of thread, other threads:[~2008-03-24 17:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-27 18:28 [Bug fortran/35395] New: Invalid-accepted - public entity with private type should be diagnosed w6ws at earthlink dot net
2008-02-27 18:31 ` [Bug fortran/35395] " w6ws at earthlink dot net
2008-02-28 10:13 ` fxcoudert at gcc dot gnu dot org
2008-03-23  9:38 ` pault at gcc dot gnu dot org
2008-03-24 17:48 ` w6ws at earthlink dot net

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).