This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/43256] [OOP] TBP with missing optional arg



------- Comment #3 from janus at gcc dot gnu dot org  2010-03-04 21:14 -------
Ok, think I got it. It's a one-liner:

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 157225)
+++ gcc/fortran/resolve.c       (working copy)
@@ -5124,7 +5124,7 @@ resolve_compcall (gfc_expr* e, bool fcn)
     return FAILURE;

   e->value.function.actual = newactual;
-  e->value.function.name = e->value.compcall.name;
+  e->value.function.name = NULL;
   e->value.function.esym = target->n.sym;
   e->value.function.class_esym = NULL;
   e->value.function.isym = NULL;


Hope this produces no regressions.

[Explanation: The problem was that 'compare_actual_formal', which sets up the
null pointer for the missing actual arg, was never called for the TBP call. Due
to e->value.function.name being set already, 'resolve_function' always assumed
the function call had already been resolved, although it was never done.]


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-03-04 21:14:06
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43256


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]