http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55855
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |diagnostic Last reconfirmed| |2013-01-03 CC| |janus at gcc dot gnu.org Ever Confirmed|0 |1 Summary|incorrect warning with |[OOP] incorrect warning |type-bound procedure |with type-bound procedure |pointer |on pointer-valued base | |object --- Comment #1 from janus at gcc dot gnu.org 2013-01-03 09:15:00 UTC --- The following draft patch seems to be sufficient to fix it: Index: gcc/fortran/expr.c =================================================================== --- gcc/fortran/expr.c (revision 194763) +++ gcc/fortran/expr.c (working copy) @@ -3151,9 +3151,8 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rval /* This is possibly a typo: x = f() instead of x => f(). */ if (gfc_option.warn_surprising - && rvalue->expr_type == EXPR_FUNCTION - && rvalue->symtree->n.sym->attr.pointer) - gfc_warning ("POINTER valued function appears on right-hand side of " + && rvalue->expr_type == EXPR_FUNCTION && gfc_expr_attr (rvalue).pointer) + gfc_warning ("POINTER-valued function appears on right-hand side of " "assignment at %L", &rvalue->where); /* Check size of array assignments. */