View | Details | Raw Unified | Return to bug 36704 | Differences between
and this patch

Collapse All | Expand All

(-)gcc/fortran/decl.c (-2 / +1 lines)
Lines 3974-3981 match_result (gfc_symbol *function, gfc_ Link Here
3974
  if (gfc_get_symbol (name, NULL, &r))
3974
  if (gfc_get_symbol (name, NULL, &r))
3975
    return MATCH_ERROR;
3975
    return MATCH_ERROR;
3976
3976
3977
  if (gfc_add_flavor (&r->attr, FL_VARIABLE, r->name, NULL) == FAILURE
3977
  if (gfc_add_result (&r->attr, r->name, NULL) == FAILURE)
3978
      || gfc_add_result (&r->attr, r->name, NULL) == FAILURE)
3979
    return MATCH_ERROR;
3978
    return MATCH_ERROR;
3980
3979
3981
  *result = r;
3980
  *result = r;
(-)gcc/fortran/trans-types.c (-2 / +4 lines)
Lines 1613-1620 gfc_sym_type (gfc_symbol * sym) Link Here
1613
  tree type;
1613
  tree type;
1614
  int byref;
1614
  int byref;
1615
1615
1616
  /* Procedure Pointers inside COMMON blocks.  */
1616
  /* Procedure Pointers inside COMMON blocks or as function result.  */
1617
  if (sym->attr.proc_pointer && sym->attr.in_common)
1617
  if (sym->attr.proc_pointer && (sym->attr.in_common || sym->attr.result))
1618
    {
1618
    {
1619
      /* Unset proc_pointer as gfc_get_function_type calls gfc_sym_type.  */
1619
      /* Unset proc_pointer as gfc_get_function_type calls gfc_sym_type.  */
1620
      sym->attr.proc_pointer = 0;
1620
      sym->attr.proc_pointer = 0;
Lines 2143-2148 gfc_get_function_type (gfc_symbol * sym) Link Here
2143
      type = gfc_typenode_for_spec (&sym->ts);
2143
      type = gfc_typenode_for_spec (&sym->ts);
2144
      sym->ts.kind = gfc_default_real_kind;
2144
      sym->ts.kind = gfc_default_real_kind;
2145
    }
2145
    }
2146
  else if (sym->result)
2147
    type = gfc_sym_type (sym->result);
2146
  else
2148
  else
2147
    type = gfc_sym_type (sym);
2149
    type = gfc_sym_type (sym);
2148
2150
(-)gcc/fortran/primary.c (-1 / +1 lines)
Lines 2509-2515 gfc_match_rvalue (gfc_expr **result) Link Here
2509
      if (gfc_matching_procptr_assignment)
2509
      if (gfc_matching_procptr_assignment)
2510
	{
2510
	{
2511
	  gfc_gobble_whitespace ();
2511
	  gfc_gobble_whitespace ();
2512
	  if (sym->attr.function && gfc_peek_ascii_char () == '(')
2512
	  if (gfc_peek_ascii_char () == '(')
2513
	    /* Parse functions returning a procptr.  */
2513
	    /* Parse functions returning a procptr.  */
2514
	    goto function0;
2514
	    goto function0;
2515
2515

Return to bug 36704