From def661340610359e6eea3cdd4189089b3b9b7acd Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 10 Feb 2006 19:01:05 +0000 Subject: re PR fortran/20858 (NULL doesn't get its argument type (kind)) 2006-02-05 Steven G. Kargl PR fortran/20858 *decl.c (variable_decl): Improve error message. Remove initialization typespec. Wrap long line. *expr.c (gfc_check_pointer_assign): Permit checking of type, kind type, and rank. *simplify.c (gfc_simplify_null): Ensure type, kind type, and rank are set. gfortran.dg/null_1.f90: New test. From-SVN: r110845 --- gcc/fortran/simplify.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'gcc/fortran/simplify.c') diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 894903b..b477078 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -2528,16 +2528,14 @@ gfc_simplify_null (gfc_expr * mold) { gfc_expr *result; - result = gfc_get_expr (); - result->expr_type = EXPR_NULL; - if (mold == NULL) - result->ts.type = BT_UNKNOWN; - else { - result->ts = mold->ts; - result->where = mold->where; + result = gfc_get_expr (); + result->ts.type = BT_UNKNOWN; } + else + result = gfc_copy_expr (mold); + result->expr_type = EXPR_NULL; return result; } -- cgit v1.1