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

--- Comment #2 from janus at gcc dot gnu.org 2011-06-28 11:05:08 UTC ---
The fix is pretty trivial:


Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c    (revision 175562)
+++ gcc/fortran/expr.c    (working copy)
@@ -4395,7 +4395,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointe
     }

   if (!pointer && e->expr_type == EXPR_FUNCTION
-      && sym->result->attr.pointer)
+      && sym->result && sym->result->attr.pointer)
     {
       if (!(gfc_option.allow_std & GFC_STD_F2008))
     {


With this one gets:

    a%ice_func()=1           ! This is the invalid line
    1
Error: Non-variable expression in variable definition context (assignment) at
(1)

Reply via email to