diff options
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 189b904..e2b6fcb 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -3447,7 +3447,19 @@ gfc_match_rvalue (gfc_expr **result) } if (gfc_matching_procptr_assignment) - goto procptr0; + { + /* It can be a procedure or a derived-type procedure or a not-yet-known + type. */ + if (sym->attr.flavor != FL_UNKNOWN + && sym->attr.flavor != FL_PROCEDURE + && sym->attr.flavor != FL_PARAMETER + && sym->attr.flavor != FL_VARIABLE) + { + gfc_error ("Symbol at %C is not appropriate for an expression"); + return MATCH_ERROR; + } + goto procptr0; + } if (sym->attr.function || sym->attr.external || sym->attr.intrinsic) goto function0; |