This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, Fortran, committed] PR 41585: [OOP] Reject CLASS(T) as component of "TYPE :: T"
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 10 Oct 2009 00:38:36 +0200
- Subject: [Patch, Fortran, committed] PR 41585: [OOP] Reject CLASS(T) as component of "TYPE :: T"
Hi all,
I just committed the one-line fix for this PR as obvious.
Cheers,
Janus
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog (Revision 152606)
+++ gcc/testsuite/ChangeLog (Arbeitskopie)
@@ -1,3 +1,8 @@
+2009-10-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41585
+ * gfortran.dg/class_2.f03: Extended test case.
+
2009-10-09 Tobias Burnus <burnus@net-b.de>
PR fortran/41582
Index: gcc/testsuite/gfortran.dg/class_2.f03
===================================================================
--- gcc/testsuite/gfortran.dg/class_2.f03 (Revision 152606)
+++ gcc/testsuite/gfortran.dg/class_2.f03 (Arbeitskopie)
@@ -34,7 +34,12 @@ abstract interface
end subroutine
end interface
+type t6
+ integer :: i
+ class(t6), allocatable :: foo ! { dg-error "must have the POINTER attribute" }
+end type t6
+
class(t1) :: o1 ! { dg-error "must be dummy, allocatable or pointer" }
class(t2), pointer :: o2 ! { dg-error "is not extensible" }
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (Revision 152606)
+++ gcc/fortran/decl.c (Arbeitskopie)
@@ -1464,9 +1464,9 @@ build_struct (const char *name, gfc_charlen *cl, g
{
gfc_component *c;
- /* If the current symbol is of the same derived type that we're
+ /* F03:C438/C439. 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)
{
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog (Revision 152606)
+++ gcc/fortran/ChangeLog (Arbeitskopie)
@@ -1,3 +1,8 @@
+2009-10-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41585
+ * decl.c (build_struct): Bugfix for CLASS components.
+
2009-10-09 Tobias Burnus <burnus@net-b.de>
PR fortran/41582