aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2009-11-04 20:41:07 +0100
committerJanus Weil <janus@gcc.gnu.org>2009-11-04 20:41:07 +0100
commit6168891d1f70ad7e962dbe9cbeac6944e9473d97 (patch)
tree8dc5a48e269a6f25b2b8af7908706f9eea0cf161
parent0bc044b8b38aea3f6bd35a8e572fbf5595c5e085 (diff)
downloadgcc-6168891d1f70ad7e962dbe9cbeac6944e9473d97.zip
gcc-6168891d1f70ad7e962dbe9cbeac6944e9473d97.tar.gz
gcc-6168891d1f70ad7e962dbe9cbeac6944e9473d97.tar.bz2
[multiple changes]
2009-11-04 Tobias Burnus <burnus@gcc.gnu.org> Janus Weil <janus@gcc.gnu.org> PR fortran/41556 PR fortran/41937 * interface.c (gfc_check_operator_interface): Handle CLASS arguments. * resolve.c (resolve_allocate_expr): Handle allocatable components of CLASS variables. 2009-11-04 Janus Weil <janus@gcc.gnu.org> PR fortran/41556 PR fortran/41937 * gfortran.dg/class_11.f03: New test. From-SVN: r153911
-rw-r--r--gcc/fortran/ChangeLog9
-rw-r--r--gcc/fortran/interface.c1
-rw-r--r--gcc/fortran/resolve.c2
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/class_11.f0337
5 files changed, 54 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 47cfead..5bf0ccc 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,12 @@
+2009-11-04 Tobias Burnus <burnus@gcc.gnu.org>
+ Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41556
+ PR fortran/41937
+ * interface.c (gfc_check_operator_interface): Handle CLASS arguments.
+ * resolve.c (resolve_allocate_expr): Handle allocatable components of
+ CLASS variables.
+
2009-11-04 Richard Guenther <rguenther@suse.de>
* options.c (gfc_post_options): Rely on common code processing
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 0fd4742..05e5d2d 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -626,6 +626,7 @@ gfc_check_operator_interface (gfc_symbol *sym, gfc_intrinsic_op op,
- Types and kinds do not conform, and
- First argument is of derived type. */
if (sym->formal->sym->ts.type != BT_DERIVED
+ && sym->formal->sym->ts.type != BT_CLASS
&& (r1 == 0 || r1 == r2)
&& (sym->formal->sym->ts.type == sym->formal->next->sym->ts.type
|| (gfc_numeric_ts (&sym->formal->sym->ts)
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 5a5fccc..4a83f22 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -6198,7 +6198,7 @@ check_symbols:
sym = a->expr->symtree->n.sym;
/* TODO - check derived type components. */
- if (sym->ts.type == BT_DERIVED)
+ if (sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS)
continue;
if ((ar->start[i] != NULL
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6786964..3066e3d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-04 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41556
+ PR fortran/41937
+ * gfortran.dg/class_11.f03: New test.
+
2009-11-04 Jason Merrill <jason@redhat.com>
PR c++/35067
diff --git a/gcc/testsuite/gfortran.dg/class_11.f03 b/gcc/testsuite/gfortran.dg/class_11.f03
new file mode 100644
index 0000000..bf80c4e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_11.f03
@@ -0,0 +1,37 @@
+! { dg-do compile }
+!
+! PR 41556
+! Contributed by Damian Rouson <damian@rouson.net>
+
+ implicit none
+
+ type ,abstract :: object
+ contains
+ procedure(assign_interface) ,deferred :: assign
+ generic :: assignment(=) => assign
+ end type
+
+ abstract interface
+ subroutine assign_interface(lhs,rhs)
+ import :: object
+ class(object) ,intent(inout) :: lhs
+ class(object) ,intent(in) :: rhs
+ end subroutine
+ end interface
+
+! PR 41937
+! Contributed by Juergen Reuter <reuter@physik.uni-freiburg.de>
+
+ type, abstract :: cuba_abstract_type
+ integer :: dim_f = 1
+ real, dimension(:), allocatable :: integral
+ end type cuba_abstract_type
+
+contains
+
+ subroutine cuba_abstract_alloc_dim_f(this)
+ class(cuba_abstract_type) :: this
+ allocate(this%integral(this%dim_f))
+ end subroutine cuba_abstract_alloc_dim_f
+
+end