diff options
| author | Steven G. Kargl <kargls@comcast.net> | 2006-02-10 19:01:05 +0000 |
|---|---|---|
| committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2006-02-10 19:01:05 +0000 |
| commit | def661340610359e6eea3cdd4189089b3b9b7acd (patch) | |
| tree | 47904c72572a1f413c0df6b9172a66991423a611 /gcc/fortran/decl.c | |
| parent | 6f4d3d86564db6a42ffb8ffa8960cc32129ab581 (diff) | |
| download | gcc-def661340610359e6eea3cdd4189089b3b9b7acd.zip gcc-def661340610359e6eea3cdd4189089b3b9b7acd.tar.gz gcc-def661340610359e6eea3cdd4189089b3b9b7acd.tar.bz2 | |
re PR fortran/20858 (NULL doesn't get its argument type (kind))
2006-02-05 Steven G. Kargl <kargls@comcast.net>
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
Diffstat (limited to 'gcc/fortran/decl.c')
| -rw-r--r-- | gcc/fortran/decl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 7a80f81..0f2436a 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1203,7 +1203,7 @@ variable_decl (int elem) m = gfc_match_null (&initializer); if (m == MATCH_NO) { - gfc_error ("Pointer initialization requires a NULL at %C"); + gfc_error ("Pointer initialization requires a NULL() at %C"); m = MATCH_ERROR; } @@ -1218,8 +1218,6 @@ variable_decl (int elem) if (m != MATCH_YES) goto cleanup; - initializer->ts = current_ts; - } else if (gfc_match_char ('=') == MATCH_YES) { @@ -1282,7 +1280,8 @@ variable_decl (int elem) t = add_init_expr_to_sym (name, &initializer, &var_locus); else { - if (current_ts.type == BT_DERIVED && !current_attr.pointer && !initializer) + if (current_ts.type == BT_DERIVED && !current_attr.pointer + && !initializer) initializer = gfc_default_initializer (¤t_ts); t = build_struct (name, cl, &initializer, &as); } |
