diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-06-08 19:11:21 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-06-08 19:11:21 +0000 |
commit | 2f2fc3252c04fbd51de8d0ff95bb85e2049f0887 (patch) | |
tree | 1bcc3e02bc3628d9a177e34a3a38fce7f3adbab0 /gcc/fortran/array.c | |
parent | 5954faa7c22d550ec57e9a40e5a738630be07b0f (diff) |
re PR fortran/86059 (ICE in reduce_binary_ac, at fortran/arith.c:1308 (and others))
2018-06-08 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/86059
* array.c (match_array_cons_element): NULL() cannot be in an
array constructor.
2018-06-08 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/86059
* gfortran.dg/associate_30.f90: Remove code tested ...
* gfortran.dg/pr67803.f90: Ditto.
* gfortran.dg/pr67805.f90: Ditto.
* gfortran.dg/pr86059.f90: ... here. New test.
From-SVN: r261344
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 36b809e3818..031ab7643a5 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; } |