[Bug fortran/40541] Assignment checking for proc-pointer => proc-ptr-returning-function()
janus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Jun 24 16:44:00 GMT 2009
------- Comment #1 from janus at gcc dot gnu dot org 2009-06-24 16:43 -------
This is easily fixed by the following patchlet (I had just forgotten about this
case):
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c (revision 148905)
+++ gcc/fortran/expr.c (working copy)
@@ -3189,10 +3189,14 @@
/* TODO: Enable interface check for PPCs. */
if (is_proc_ptr_comp (rvalue, NULL))
return SUCCESS;
- if (rvalue->expr_type == EXPR_VARIABLE
- && !gfc_compare_interfaces (lvalue->symtree->n.sym,
- rvalue->symtree->n.sym, 0, 1, err,
- sizeof(err)))
+ if ((rvalue->expr_type == EXPR_VARIABLE
+ && !gfc_compare_interfaces (lvalue->symtree->n.sym,
+ rvalue->symtree->n.sym, 0, 1, err,
+ sizeof(err)))
+ || (rvalue->expr_type == EXPR_FUNCTION
+ && !gfc_compare_interfaces (lvalue->symtree->n.sym,
+ rvalue->symtree->n.sym->result, 0, 1,
+ err, sizeof(err))))
{
gfc_error ("Interface mismatch in procedure pointer assignment "
"at %L: %s", &rvalue->where, err);
However, there remains one problem (aka PR 39695): The error message for the
code in comment #0 has the wrong name:
p => f()
1
Error: Interface mismatch in procedure pointer assignment at (1): Type/kind
mismatch in return value of 'ppr@'
--
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 |2009-06-24 16:43:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40541
More information about the Gcc-bugs
mailing list