aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2011-06-16 23:45:26 +0200
committerJanus Weil <janus@gcc.gnu.org>2011-06-16 23:45:26 +0200
commit67a7c837e95e85c607e55d2b72bfd4da43f0dd16 (patch)
tree57cf30b4866ac8ab5fa871c4f1849062b8ecc116
parent45f86e0f6e1b0fdd6676848c7e929a4cbc85cd8f (diff)
downloadgcc-67a7c837e95e85c607e55d2b72bfd4da43f0dd16.zip
gcc-67a7c837e95e85c607e55d2b72bfd4da43f0dd16.tar.gz
gcc-67a7c837e95e85c607e55d2b72bfd4da43f0dd16.tar.bz2
re PR fortran/49074 ([OOP] Defined assignment w/ CLASS arrays: Incomplete error message)
2011-06-16 Janus Weil <janus@gcc.gnu.org> PR fortran/49074 * interface.c (gfc_extend_assign): Propagate the locus from the assignment to the type-bound procedure call. 2011-06-16 Janus Weil <janus@gcc.gnu.org> PR fortran/49074 * gfortran.dg/typebound_assignment_3.f03: New. From-SVN: r175113
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/interface.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_assignment_3.f0330
4 files changed, 42 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8d3b9b9..e042821 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,11 @@
2011-06-16 Janus Weil <janus@gcc.gnu.org>
+ PR fortran/49074
+ * interface.c (gfc_extend_assign): Propagate the locus from the
+ assignment to the type-bound procedure call.
+
+2011-06-16 Janus Weil <janus@gcc.gnu.org>
+
PR fortran/49417
* module.c (mio_component): Make sure the 'class_ok' attribute is set
for use-associated CLASS components.
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 46f9d14..e787187 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -3242,6 +3242,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
c->expr1 = gfc_get_expr ();
build_compcall_for_operator (c->expr1, actual, tb_base, tbo, gname);
c->expr1->value.compcall.assign = 1;
+ c->expr1->where = c->loc;
c->expr2 = NULL;
c->op = EXEC_COMPCALL;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5d9fc89..68da027 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-16 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/49074
+ * gfortran.dg/typebound_assignment_3.f03: New.
+
2011-06-16 Steve Ellcey <sje@cup.hp.com>
PR testsuite/48727
diff --git a/gcc/testsuite/gfortran.dg/typebound_assignment_3.f03 b/gcc/testsuite/gfortran.dg/typebound_assignment_3.f03
new file mode 100644
index 0000000..ce84a39
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_assignment_3.f03
@@ -0,0 +1,30 @@
+! { dg-do compile }
+!
+! PR 49074: [OOP] Defined assignment w/ CLASS arrays: Incomplete error message
+!
+! Contribute by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+module foo
+
+ type bar
+ contains
+ generic :: assignment (=) => assgn
+ procedure :: assgn
+ end type
+
+contains
+
+ elemental subroutine assgn (a, b)
+ class (bar), intent (inout) :: a
+ class (bar), intent (in) :: b
+ end subroutine
+
+end module
+
+
+ use foo
+ type (bar) :: foobar(2)
+ foobar = bar() ! { dg-error "currently not implemented" }
+end
+
+! { dg-final { cleanup-modules "foo" } }