re PR fortran/49074 ([OOP] Defined assignment w/ CLASS arrays: Incomplete error message)
authorJanus Weil <janus@gcc.gnu.org>
Thu, 16 Jun 2011 21:45:26 +0000 (23:45 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Thu, 16 Jun 2011 21:45:26 +0000 (23:45 +0200)
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

gcc/fortran/ChangeLog
gcc/fortran/interface.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/typebound_assignment_3.f03 [new file with mode: 0644]

index 8d3b9b96ec6d473cd6eb94482eb8eb348d0c2c5c..e0428211dd7f23446001ce62fffd586e359f1d64 100644 (file)
@@ -1,3 +1,9 @@
+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
index 46f9d146ce74e0d18013c3752ac4368dd65d0e13..e787187ba8075d239c6484120f84b8831c418948 100644 (file)
@@ -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;
 
index 5d9fc892873c8ebd6005afb47a146e0c1a597e66..68da027be3d413ff81692a2173c9225671065d4d 100644 (file)
@@ -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 (file)
index 0000000..ce84a39
--- /dev/null
@@ -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" } }