diff options
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 14253f6f1bd..0e3b6c0a139 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -941,6 +941,8 @@ got_delim: e->ref = NULL; e->ts.type = BT_CHARACTER; e->ts.kind = kind; + e->ts.is_c_interop = 0; + e->ts.is_iso_c = 0; e->where = start_locus; e->value.character.string = p = gfc_getmem (length + 1); @@ -1012,6 +1014,8 @@ match_logical_constant (gfc_expr **result) e->value.logical = i; e->ts.type = BT_LOGICAL; e->ts.kind = kind; + e->ts.is_c_interop = 0; + e->ts.is_iso_c = 0; e->where = gfc_current_locus; *result = e; @@ -1196,6 +1200,8 @@ match_complex_constant (gfc_expr **result) } target.type = BT_REAL; target.kind = kind; + target.is_c_interop = 0; + target.is_iso_c = 0; if (real->ts.type != BT_REAL || kind != real->ts.kind) gfc_convert_type (real, &target, 2); @@ -2190,6 +2196,25 @@ gfc_match_rvalue (gfc_expr **result) break; } + /* Check here for the existence of at least one argument for the + iso_c_binding functions C_LOC, C_FUNLOC, and C_ASSOCIATED. The + argument(s) given will be checked in gfc_iso_c_func_interface, + during resolution of the function call. */ + if (sym->attr.is_iso_c == 1 + && (sym->from_intmod == INTMOD_ISO_C_BINDING + && (sym->intmod_sym_id == ISOCBINDING_LOC + || sym->intmod_sym_id == ISOCBINDING_FUNLOC + || sym->intmod_sym_id == ISOCBINDING_ASSOCIATED))) + { + /* make sure we were given a param */ + if (actual_arglist == NULL) + { + gfc_error ("Missing argument to '%s' at %C", sym->name); + m = MATCH_ERROR; + break; + } + } + if (sym->result == NULL) sym->result = sym; |