Summary: | [OOP] Reject CLASS(T) as component of "TYPE :: T" | ||
---|---|---|---|
Product: | gcc | Reporter: | Tobias Burnus <burnus> |
Component: | fortran | Assignee: | janus |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, janus |
Priority: | P3 | Keywords: | rejects-valid |
Version: | 4.5.0 | ||
Target Milestone: | 4.5.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2009-10-07 21:50:03 |
Description
Tobias Burnus
2009-10-05 13:22:12 UTC
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) { 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 |