diff options
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 0aee220..396dd97 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1110,17 +1110,27 @@ match_array_cons_element (gfc_constructor_base *result) if (m != MATCH_YES) return m; + if (expr->ts.type == BT_BOZ) + { + gfc_error ("BOZ literal constant at %L cannot appear in an " + "array constructor", &expr->where); + goto done; + } + 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; - } + goto done; + } gfc_constructor_append_expr (result, expr, &gfc_current_locus); return MATCH_YES; + +done: + gfc_free_expr (expr); + return MATCH_ERROR; } |