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/40593] Proc-pointer returning function as actual argument



------- Comment #4 from janus at gcc dot gnu dot org  2009-07-01 08:35 -------
The second example in comment #0 is fixed by the following patch:

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 149129)
+++ gcc/fortran/resolve.c       (working copy)
@@ -1828,7 +1828,10 @@ resolve_specific_f0 (gfc_symbol *sym, gf
 found:
   gfc_procedure_use (sym, &expr->value.function.actual, &expr->where);

-  expr->ts = sym->ts;
+  if (sym->result)
+    expr->ts = sym->result->ts;
+  else
+    expr->ts = sym->ts;
   expr->value.function.name = sym->name;
   expr->value.function.esym = sym;
   if (sym->as != NULL)


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-07-01 08:35:59
               date|                            |


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


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