public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug fortran/41585] New: [OOP] Reject CLASS(T) as component of "TYPE :: T" @ 2009-10-05 13:22 burnus at gcc dot gnu dot org 2009-10-05 13:27 ` [Bug fortran/41585] " burnus at gcc dot gnu dot org ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: burnus at gcc dot gnu dot org @ 2009-10-05 13:22 UTC (permalink / raw) To: gcc-bugs type t integer :: i class(t), allocatable :: foo end type t In Fortran 2003 this is invalid to have CLASS(T) in the same TYPE as the one being defined. I think Fortran 2008 allows this, but as currently, deallocating also does not work, I would simply reject it. C438 (R440) If the POINTER attribute is not specified for a component, the declaration-type-spec in the component-def-stmt shall be CLASS(*) or shall specify an intrinsic type or a previously defined derived type. C439 (R440) If the POINTER attribute is specified for a component, the declaration-type-spec in the component-def-stmt shall be CLASS(*) or shall specify an intrinsic type or any accessible derived type including the type being defined. -- Summary: [OOP] Reject CLASS(T) as component of "TYPE :: T" Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: rejects-valid 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=41585 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/41585] [OOP] Reject CLASS(T) as component of "TYPE :: T" 2009-10-05 13:22 [Bug fortran/41585] New: [OOP] Reject CLASS(T) as component of "TYPE :: T" burnus at gcc dot gnu dot org @ 2009-10-05 13:27 ` burnus at gcc dot gnu dot org 2009-10-07 21:50 ` janus at gcc dot gnu dot org ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: burnus at gcc dot gnu dot org @ 2009-10-05 13:27 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from burnus at gcc dot gnu dot org 2009-10-05 13:27 ------- See also PR 41586. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41585 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/41585] [OOP] Reject CLASS(T) as component of "TYPE :: T" 2009-10-05 13:22 [Bug fortran/41585] New: [OOP] Reject CLASS(T) as component of "TYPE :: T" burnus at gcc dot gnu dot org 2009-10-05 13:27 ` [Bug fortran/41585] " burnus at gcc dot gnu dot org @ 2009-10-07 21:50 ` janus at gcc dot gnu dot org 2009-10-09 22:35 ` janus at gcc dot gnu dot org 2009-10-09 22:39 ` janus at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: janus at gcc dot gnu dot org @ 2009-10-07 21:50 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from janus at gcc dot gnu dot org 2009-10-07 21:50 ------- This can be fixed by: Index: gcc/fortran/decl.c =================================================================== --- gcc/fortran/decl.c (Revision 152525) +++ gcc/fortran/decl.c (Arbeitskopie) @@ -1465,7 +1465,7 @@ build_struct (const char *name, gfc_charlen *cl, g /* If the current symbol is of the same derived type that we're constructing, it must have the pointer attribute. */ - if (current_ts.type == BT_DERIVED + if ((current_ts.type == BT_DERIVED || current_ts.type == BT_CLASS) && current_ts.u.derived == gfc_current_block () && current_attr.pointer == 0) { -- janus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |janus at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2009-10-07 21:50:03 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41585 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/41585] [OOP] Reject CLASS(T) as component of "TYPE :: T" 2009-10-05 13:22 [Bug fortran/41585] New: [OOP] Reject CLASS(T) as component of "TYPE :: T" burnus at gcc dot gnu dot org 2009-10-05 13:27 ` [Bug fortran/41585] " burnus at gcc dot gnu dot org 2009-10-07 21:50 ` janus at gcc dot gnu dot org @ 2009-10-09 22:35 ` janus at gcc dot gnu dot org 2009-10-09 22:39 ` janus at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: janus at gcc dot gnu dot org @ 2009-10-09 22:35 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from janus at gcc dot gnu dot org 2009-10-09 22:35 ------- Subject: Bug 41585 Author: janus Date: Fri Oct 9 22:35:11 2009 New Revision: 152608 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152608 Log: 2009-10-09 Janus Weil <janus@gcc.gnu.org> PR fortran/41585 * decl.c (build_struct): Bugfix for CLASS components. 2009-10-09 Janus Weil <janus@gcc.gnu.org> PR fortran/41585 * gfortran.dg/class_2.f03: Extended test case. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/class_2.f03 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41585 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/41585] [OOP] Reject CLASS(T) as component of "TYPE :: T" 2009-10-05 13:22 [Bug fortran/41585] New: [OOP] Reject CLASS(T) as component of "TYPE :: T" burnus at gcc dot gnu dot org ` (2 preceding siblings ...) 2009-10-09 22:35 ` janus at gcc dot gnu dot org @ 2009-10-09 22:39 ` janus at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: janus at gcc dot gnu dot org @ 2009-10-09 22:39 UTC (permalink / raw) To: gcc-bugs ------- Comment #4 from janus at gcc dot gnu dot org 2009-10-09 22:39 ------- Fixed with r152608. Closing. -- janus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41585 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-09 22:39 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-10-05 13:22 [Bug fortran/41585] New: [OOP] Reject CLASS(T) as component of "TYPE :: T" burnus at gcc dot gnu dot org 2009-10-05 13:27 ` [Bug fortran/41585] " burnus at gcc dot gnu dot org 2009-10-07 21:50 ` janus at gcc dot gnu dot org 2009-10-09 22:35 ` janus at gcc dot gnu dot org 2009-10-09 22:39 ` janus 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).