diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-17 09:40:12 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-17 09:40:12 +0000 |
commit | 926b8757b987fb9a6ab5c6b5ec7177f6fd2282cd (patch) | |
tree | 4201cb480d0a338993f8d7f5a9550c6839536d71 /gcc/fortran | |
parent | 84a1059bbaff0dc6dcb2472e83046e218cff78b8 (diff) | |
download | gcc-926b8757b987fb9a6ab5c6b5ec7177f6fd2282cd.tar.gz |
2012-07-17 Tobias Burnus <burnus@net-b.de>
PR fortran/52101
* decl.c (match_char_length): Extra argument, show obsolenscent
warning only if *length is used after the typename.
(variable_decl, gfc_match_char_spec): Update call
2012-07-17 Tobias Burnus <burnus@net-b.de>
PR fortran/52101
* gfortran.dg/oldstyle_4.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189565 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 11 |
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index fede706c0c6..90420147802 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,11 @@ 2012-07-17 Tobias Burnus <burnus@net-b.de> + + PR fortran/52101 + * decl.c (match_char_length): Extra argument, show obsolenscent + warning only if *length is used after the typename. + (variable_decl, gfc_match_char_spec): Update call + +2012-07-17 Tobias Burnus <burnus@net-b.de> Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/49265 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 9bd3dc3a688..89d501cdc18 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -723,7 +723,7 @@ syntax: char_len_param_value in parenthesis. */ static match -match_char_length (gfc_expr **expr, bool *deferred) +match_char_length (gfc_expr **expr, bool *deferred, bool obsolenscent_check) { int length; match m; @@ -739,8 +739,9 @@ match_char_length (gfc_expr **expr, bool *deferred) if (m == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: " - "Old-style character length at %C") == FAILURE) + if (obsolenscent_check + && gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: " + "Old-style character length at %C") == FAILURE) return MATCH_ERROR; *expr = gfc_get_int_expr (gfc_default_integer_kind, NULL, length); return m; @@ -1849,7 +1850,7 @@ variable_decl (int elem) if (current_ts.type == BT_CHARACTER) { - switch (match_char_length (&char_len, &cl_deferred)) + switch (match_char_length (&char_len, &cl_deferred, false)) { case MATCH_YES: cl = gfc_new_charlen (gfc_current_ns, NULL); @@ -2411,7 +2412,7 @@ gfc_match_char_spec (gfc_typespec *ts) /* Try the old-style specification first. */ old_char_selector = 0; - m = match_char_length (&len, &deferred); + m = match_char_length (&len, &deferred, true); if (m != MATCH_NO) { if (m == MATCH_YES) |