diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-18 12:21:38 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-18 12:21:38 +0000 |
commit | c363985622c2d0acdea075fb7a415cd9d3de1689 (patch) | |
tree | b4a34c50935449f36aaace2f13d03cbaffac2ad3 /gcc/fortran/primary.c | |
parent | d40a7894f05687e9fc3ba48d32ad4e447b429768 (diff) | |
download | gcc-c363985622c2d0acdea075fb7a415cd9d3de1689.tar.gz |
2015-01-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55901
* primary.c (gfc_match_varspec): Exclude dangling associate-
names with dimension 0 from being counted as arrays.
* resolve.c (resolve_assoc_var): Sub-strings are permissible
for associate-names, so exclude characters from the test for
misuse as arrays.
* trans-decl.c (gfc_get_symbol_decl): Associate-names can use
the hidden string length variable of their associated target.
Signal this by setting 'length' to a constant, if the decl for
the string length is a variable.
2015-01-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/55901
* gfortran.dg/associate_1.f03: Allow test for character with
automatic length.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219814 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index cbe7aa60e7b..141f8cc1ed6 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1857,7 +1857,10 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, Thus if we have one and parentheses follow, we have to assume that it actually is one for now. The final decision will be made at resolution time, of course. */ - if (sym->assoc && gfc_peek_ascii_char () == '(') + if (sym->assoc && gfc_peek_ascii_char () == '(' + && !(sym->assoc->dangling && sym->assoc->st + && sym->assoc->st->n.sym + && sym->assoc->st->n.sym->attr.dimension == 0)) sym->attr.dimension = 1; if ((equiv_flag && gfc_peek_ascii_char () == '(') |