http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54263
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-08-15
08:28:10 UTC ---
Something like the following should do.
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -3544,3 +3547,12 @@ gfc_iso_c_sub_interface (gfc_code *c, gfc_symbol *sym)
gfc_procedure_use() (called above to sort actual args). */
- if (c->ext.actual->next->expr->rank != 0)
+ if (c->ext.actual->next->next
+ && c->ext.actual->next->next->expr
+ && c->ext.actual->next->expr->rank == 0)
+ {
+ gfc_error ("Unexpected SHAPE argument at %L with scalar FPTR "
+ "in call to C_F_POINTER",
+ &c->ext.actual->next->next->expr->where);
+ m = MATCH_ERROR;
+ }
+ else if (c->ext.actual->next->expr->rank != 0)
{