public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/23994] New: PROTECTED attribute (F2003) is not implemented
@ 2005-09-21 10:45 fxcoudert at gcc dot gnu dot org
  2005-09-21 10:56 ` [Bug fortran/23994] " tobi at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-09-21 10:45 UTC (permalink / raw)
  To: gcc-bugs

Fortran 2003 defines the PROTECTED attribute for variables in modules. Example:

-----------------------------------
MODULE temperature
 REAL,PROTECTED :: temp
 CONTAINS
 SUBROUTINE set_temperature
   temp = 0.0
 END SUBROUTINE
END MODULE

use temperature
call set_temperature
print *, temp
temp = 42
end
-----------------------------------

The compiler should issue an error message on that code (temp cannot be modified
from outside the module) but the code should compile fine without the "temp =
42" line.

The only compiler I know that behaves correctly right now is IBM's.

-- 
           Summary: PROTECTED attribute (F2003) is not implemented
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 20585
             nThis:


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


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

* [Bug fortran/23994] PROTECTED attribute (F2003) is not implemented
  2005-09-21 10:45 [Bug fortran/23994] New: PROTECTED attribute (F2003) is not implemented fxcoudert at gcc dot gnu dot org
@ 2005-09-21 10:56 ` tobi at gcc dot gnu dot org
  2005-09-21 11:26 ` fxcoudert at gcc dot gnu dot org
  2005-09-21 11:32 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 9+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-09-21 10:56 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-21 10:55:59
               date|                            |


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


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

* [Bug fortran/23994] PROTECTED attribute (F2003) is not implemented
  2005-09-21 10:45 [Bug fortran/23994] New: PROTECTED attribute (F2003) is not implemented fxcoudert at gcc dot gnu dot org
  2005-09-21 10:56 ` [Bug fortran/23994] " tobi at gcc dot gnu dot org
@ 2005-09-21 11:26 ` fxcoudert at gcc dot gnu dot org
  2005-09-21 11:32 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-09-21 11:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-09-21 11:26 -------
[in answer to pinskia, who added the keyword accepts-invalid]

Currently, gfortran doesn't accept this code:

$ gfortran -std=f2003 a.f90
 In file a.f90:2

 REAL,PROTECTED :: temp
    1
Error: Syntax error in data declaration at (1)

In the future, it should accept the PROTECTED attribute at line 2, and issue an
error (or warning) at line 12. Removing keyword accordingly.

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


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


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

* [Bug fortran/23994] PROTECTED attribute (F2003) is not implemented
  2005-09-21 10:45 [Bug fortran/23994] New: PROTECTED attribute (F2003) is not implemented fxcoudert at gcc dot gnu dot org
  2005-09-21 10:56 ` [Bug fortran/23994] " tobi at gcc dot gnu dot org
  2005-09-21 11:26 ` fxcoudert at gcc dot gnu dot org
@ 2005-09-21 11:32 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-21 11:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-21 11:32 -------
I got this wrong because I thought from comment one it was accepting the attribute already but just 
ignoring it.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid


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


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

* [Bug fortran/23994] PROTECTED attribute (F2003) is not implemented
       [not found] <bug-23994-10259@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-12-10 19:53 ` burnus at gcc dot gnu dot org
@ 2006-12-10 23:38 ` steven at gcc dot gnu dot org
  4 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-12-10 23:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from steven at gcc dot gnu dot org  2006-12-10 23:38 -------
Fixed in GCC 4.3


-- 

steven at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/23994] PROTECTED attribute (F2003) is not implemented
       [not found] <bug-23994-10259@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-12-10 11:55 ` patchapp at dberlin dot org
@ 2006-12-10 19:53 ` burnus at gcc dot gnu dot org
  2006-12-10 23:38 ` steven at gcc dot gnu dot org
  4 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-12-10 19:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at gcc dot gnu dot org  2006-12-10 19:53 -------
Subject: Bug 23994

Author: burnus
Date: Sun Dec 10 19:53:07 2006
New Revision: 119709

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119709
Log:
fortran/
2006-12-10  Tobias Burnus  <burnus@net-b.de>

    PR fortran/23994
    * interface.c (compare_actual_formal): PROTECTED is incompatible
with intent(out).
    * symbol.c (check_conflict): Check for PROTECTED conflicts.
      (gfc_add_protected): New function.
      (gfc_copy_attr): Copy PROTECTED attribute.
    * decl.c (match_attr_spec): Add PROTECTED support.
      (gfc_match_protected): New function.
    * dump-parse-tree.c (gfc_show_attr): Add PROTECTED support.
    * gfortran.h (gfc_symbol): Add protected flag.
      Add gfc_add_protected prototype.
    * expr.c (gfc_check_pointer_assign): Add PROTECTED support.
    * module.c (ab_attribute, attr_bits, mio_symbol_attribute,
mio_symbol_attribute):
       Add PROTECTED support.
    * resolve.c (resolve_equivalence): Add PROTECTED support.
    * match.c (gfc_match_assignment,)gfc_match_pointer_assignment:
       Check PROTECTED attribute.
    * match.h: Add gfc_match_protected prototype.
    * parse.c (decode_statement): Match PROTECTED statement.
    * primary.c (match_variable): Add PROTECTED support.

testsuite/
2006-12-10  Tobias Burnus  <burnus@net-b.de>

    PR fortran/23994
    * gfortran.dg/protected_1.f90: New test.
    * gfortran.dg/protected_2.f90: New test.
    * gfortran.dg/protected_3.f90: New test.
    * gfortran.dg/protected_4.f90: New test.
    * gfortran.dg/protected_5.f90: New test.
    * gfortran.dg/protected_6.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/protected_1.f90
    trunk/gcc/testsuite/gfortran.dg/protected_2.f90
    trunk/gcc/testsuite/gfortran.dg/protected_3.f90
    trunk/gcc/testsuite/gfortran.dg/protected_4.f90
    trunk/gcc/testsuite/gfortran.dg/protected_5.f90
    trunk/gcc/testsuite/gfortran.dg/protected_6.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/dump-parse-tree.c
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/interface.c
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/match.h
    trunk/gcc/fortran/module.c
    trunk/gcc/fortran/parse.c
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/23994] PROTECTED attribute (F2003) is not implemented
       [not found] <bug-23994-10259@http.gcc.gnu.org/bugzilla/>
  2006-05-08  8:37 ` fxcoudert at gcc dot gnu dot org
  2006-11-07 21:41 ` pault at gcc dot gnu dot org
@ 2006-12-10 11:55 ` patchapp at dberlin dot org
  2006-12-10 19:53 ` burnus at gcc dot gnu dot org
  2006-12-10 23:38 ` steven at gcc dot gnu dot org
  4 siblings, 0 replies; 9+ messages in thread
From: patchapp at dberlin dot org @ 2006-12-10 11:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from patchapp at dberlin dot org  2006-12-10 11:55 -------
Subject: Bug number PR23994

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/2006-12/msg00663.html


-- 


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


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

* [Bug fortran/23994] PROTECTED attribute (F2003) is not implemented
       [not found] <bug-23994-10259@http.gcc.gnu.org/bugzilla/>
  2006-05-08  8:37 ` fxcoudert at gcc dot gnu dot org
@ 2006-11-07 21:41 ` pault at gcc dot gnu dot org
  2006-12-10 11:55 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-07 21:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2006-11-07 21:41 -------
Have removed the rejects-valid keyword.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |


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


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

* [Bug fortran/23994] PROTECTED attribute (F2003) is not implemented
       [not found] <bug-23994-10259@http.gcc.gnu.org/bugzilla/>
@ 2006-05-08  8:37 ` fxcoudert at gcc dot gnu dot org
  2006-11-07 21:41 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-05-08  8:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from fxcoudert at gcc dot gnu dot org  2006-05-08 08:37 -------
A good documentation for PROTECTED, in addition to the standard itself, is
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.xlf101a.doc/xlflr/protected.htm


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-12-30 19:42:01         |2006-05-08 08:37:39
               date|                            |


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


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

end of thread, other threads:[~2006-12-10 23:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-21 10:45 [Bug fortran/23994] New: PROTECTED attribute (F2003) is not implemented fxcoudert at gcc dot gnu dot org
2005-09-21 10:56 ` [Bug fortran/23994] " tobi at gcc dot gnu dot org
2005-09-21 11:26 ` fxcoudert at gcc dot gnu dot org
2005-09-21 11:32 ` pinskia at gcc dot gnu dot org
     [not found] <bug-23994-10259@http.gcc.gnu.org/bugzilla/>
2006-05-08  8:37 ` fxcoudert at gcc dot gnu dot org
2006-11-07 21:41 ` pault at gcc dot gnu dot org
2006-12-10 11:55 ` patchapp at dberlin dot org
2006-12-10 19:53 ` burnus at gcc dot gnu dot org
2006-12-10 23:38 ` steven 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).