diff options
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 36b809e..031ab76 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1098,6 +1098,15 @@ match_array_cons_element (gfc_constructor_base *result) if (m != MATCH_YES) return m; + if (expr->expr_type == EXPR_FUNCTION + && expr->ts.type == BT_UNKNOWN + && strcmp(expr->symtree->name, "null") == 0) + { + gfc_error ("NULL() at %C cannot appear in an array constructor"); + gfc_free_expr (expr); + return MATCH_ERROR; + } + gfc_constructor_append_expr (result, expr, &gfc_current_locus); return MATCH_YES; } |