This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49074] [OOP] Defined assignment w/ CLASS arrays: Incomplete error message
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Jun 2011 18:24:40 +0000
- Subject: [Bug fortran/49074] [OOP] Defined assignment w/ CLASS arrays: Incomplete error message
- Auto-submitted: auto-generated
- References: <bug-49074-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49074
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org
|gnu.org |
--- Comment #3 from janus at gcc dot gnu.org 2011-06-16 18:24:15 UTC ---
Ok, in fact we just fail to propagate the locus when replacing the assignment
with the corresponding type-bound call. The following one-liner fixes it:
Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c (revision 175100)
+++ gcc/fortran/interface.c (working copy)
@@ -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;
With this one gets the correct error message:
foobar = [bar(1), bar(2)]
1
Error: Non-scalar base object at (1) currently not implemented
Will commit as obvious after regtesting.