http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51081
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org
|gnu.org |
--- Comment #7 from janus at gcc dot gnu.org 2012-07-18 12:54:32 UTC ---
(In reply to comment #6)
> ToDo: Fix the bogus errors about INT and INT2, cf. comment 2 and 3.
The following patch makes the test case in comment #1 work:
Index: gcc/fortran/primary.c
===================================================================
--- gcc/fortran/primary.c (revision 189608)
+++ gcc/fortran/primary.c (working copy)
@@ -2843,9 +2843,6 @@ gfc_match_rvalue (gfc_expr **result)
/* Parse functions returning a procptr. */
goto function0;
- if (gfc_is_intrinsic (sym, 0, gfc_current_locus)
- || gfc_is_intrinsic (sym, 1, gfc_current_locus))
- sym->attr.intrinsic = 1;
e = gfc_get_expr ();
e->expr_type = EXPR_VARIABLE;
e->symtree = symtree;
However, it regresses on proc_ptr_{1,6,11,12,15}.f90 and sizeof_proc.f90.
Surely the setting of attr.intrinsic comes too early in gfc_match_rvalue. It
probably should be deferred to resolution stage, where we know about the
presence of the internal proc.