aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2010-10-12 15:30:53 +0200
committerDaniel Kraft <domob@gcc.gnu.org>2010-10-12 15:30:53 +0200
commita81f4b678524dbc3c3614f785c5bfee0944ce522 (patch)
tree990f5cbdbf6138633ef12dc690bc1ecdae5a3b56 /gcc/fortran/parse.c
parentf166413ae0e3dd76bc8c83d9865bcff20d5623aa (diff)
downloadgcc-a81f4b678524dbc3c3614f785c5bfee0944ce522.zip
gcc-a81f4b678524dbc3c3614f785c5bfee0944ce522.tar.gz
gcc-a81f4b678524dbc3c3614f785c5bfee0944ce522.tar.bz2
re PR fortran/38936 ([F03] ASSOCIATE construct / improved SELECT TYPE (a=>expr))
2010-10-12 Daniel Kraft <d@domob.eu> PR fortran/38936 * parse.c (parse_associate): Set typespec of associate-name if that of the target is already available. 2010-10-12 Daniel Kraft <d@domob.eu> PR fortran/38936 * gfortran.dg/associate_1.f03: More tests with derived-types. * gfortran.dg/associate_9.f03: New test (XFAIL for now). * gfortran.dg/associate_8.f03: Fix typo. * gfortran.dg/initialization_27.f90: Fix typo. From-SVN: r165378
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 268e6af..89ffbaf 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -3237,6 +3237,13 @@ parse_associate (void)
sym->assoc = a;
sym->declared_at = a->where;
gfc_set_sym_referenced (sym);
+
+ /* Initialize the typespec. It is not available in all cases,
+ however, as it may only be set on the target during resolution.
+ Still, sometimes it helps to have it right now -- especially
+ for parsing component references on the associate-name
+ in case of assication to a derived-type. */
+ sym->ts = a->target->ts;
}
accept_statement (ST_ASSOCIATE);