aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2010-08-15 21:46:21 +0200
committerDaniel Kraft <domob@gcc.gnu.org>2010-08-15 21:46:21 +0200
commit52bf62f96ba3f69fcd35251624d6767299331b4a (patch)
tree2ede6f192c42897061be312972730b088b7b2ee4 /gcc/fortran/primary.c
parent5fc265c14ff7c8c382dc9d1ba0fb26b2819d1d09 (diff)
downloadgcc-52bf62f96ba3f69fcd35251624d6767299331b4a.zip
gcc-52bf62f96ba3f69fcd35251624d6767299331b4a.tar.gz
gcc-52bf62f96ba3f69fcd35251624d6767299331b4a.tar.bz2
re PR fortran/38936 ([F03] ASSOCIATE construct / improved SELECT TYPE (a=>expr))
2010-08-15 Daniel Kraft <d@domob.eu> PR fortran/38936 * gfortran.h (gfc_find_proc_namespace): New method. * expr.c (gfc_build_intrinsic_call): No need to build symtree messing around with namespace. * symbol.c (gfc_find_proc_namespace): New method. * trans-decl.c (gfc_build_qualified_array): Use it for correct value of nest. * primary.c (gfc_match_varspec): Handle associate-names as arrays. * parse.c (parse_associate): Removed assignment-generation here... * resolve.c (resolve_block_construct): ...and added it here. (resolve_variable): Handle names that are arrays but were not parsed as such because of association. (resolve_code): Fix BLOCK resolution. (resolve_symbol): Generate array-spec for associate-names. 2010-08-15 Daniel Kraft <d@domob.eu> PR fortran/38936 * gfortran.dg/associate_1.f03: Enable test for array expressions. * gfortran.dg/associate_3.f03: Clarify comment. * gfortran.dg/associate_5.f03: New test. * gfortran.dg/associate_6.f03: New test. From-SVN: r163268
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index cb6fae2..0777046 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1748,6 +1748,13 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
}
}
+ /* For associate names, we may not yet know whether they are arrays or not.
+ 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 () == '(')
+ sym->attr.dimension = 1;
+
if ((equiv_flag && gfc_peek_ascii_char () == '(')
|| gfc_peek_ascii_char () == '[' || sym->attr.codimension
|| (sym->attr.dimension && !sym->attr.proc_pointer