This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54285] [F03] Calling a PPC with proc-ptr result
- 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 Aug 2012 20:33:22 +0000
- Subject: [Bug fortran/54285] [F03] Calling a PPC with proc-ptr result
- Auto-submitted: auto-generated
- References: <bug-54285-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54285
--- Comment #1 from janus at gcc dot gnu.org 2012-08-16 20:33:22 UTC ---
The following patch fixes the error message in comment 0:
Index: gcc/fortran/primary.c
===================================================================
--- gcc/fortran/primary.c (revision 190419)
+++ gcc/fortran/primary.c (working copy)
@@ -2004,8 +2004,7 @@ gfc_match_varspec (gfc_expr *primary, int equiv_fl
primary->ts = component->ts;
- if (component->attr.proc_pointer && ppc_arg
- && !gfc_matching_procptr_assignment)
+ if (component->attr.proc_pointer && ppc_arg)
{
/* Procedure pointer component call: Look for argument list. */
m = gfc_match_actual_arglist (sub_flag,
@@ -2014,7 +2013,7 @@ gfc_match_varspec (gfc_expr *primary, int equiv_fl
return MATCH_ERROR;
if (m == MATCH_NO && !gfc_matching_ptr_assignment
- && !matching_actual_arglist)
+ && !gfc_matching_procptr_assignment && !matching_actual_arglist)
{
gfc_error ("Procedure pointer component '%s' requires an "
"argument list at %C", component->name);
However, with this one gets:
pp => x%p()
1
Error: Interface mismatch in procedure pointer assignment at (1): 'p' has the
wrong number of arguments
... which is obviously not true. Apparently the formal args of pp are compared
to the formal args of x%p itself, and not to those of the result of x%p.