https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100154
--- Comment #8 from anlauf at gcc dot gnu.org --- (In reply to anlauf from comment #7) > Do you think the following is the right thing? Correction: diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 82db8e4e1b2..e1ec1c610e8 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -1055,6 +1055,13 @@ variable_check (gfc_expr *e, int n, bool allow_proc) return true; } + /* F2018:R902: function reference having a data pointer result. */ + if (e->expr_type == EXPR_FUNCTION + && e->symtree->n.sym->attr.flavor == FL_PROCEDURE + && e->symtree->n.sym->attr.function + && e->symtree->n.sym->attr.pointer) + return true; + gfc_error ("%qs argument of %qs intrinsic at %L must be a variable", gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic, &e->where); It's getting late...