aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2010-12-11 23:04:06 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2010-12-11 23:04:06 +0100
commita70de21ffba9c1c8b4c5096bf9faf3deeb054c76 (patch)
tree8646350dc5a6c869ac5b7a700195ae944f31614a /gcc/fortran/resolve.c
parent1dbe5c7838f306d8867802fa6e394d0fa5e1bf86 (diff)
downloadgcc-a70de21ffba9c1c8b4c5096bf9faf3deeb054c76.zip
gcc-a70de21ffba9c1c8b4c5096bf9faf3deeb054c76.tar.gz
gcc-a70de21ffba9c1c8b4c5096bf9faf3deeb054c76.tar.bz2
re PR fortran/46370 ([Coarray] [OOP] ALLOCATE: Error allocating CLASS coarrays)
2010-12-11 Tobias Burnus <burnus@net-b.de> PR fortran/46370 * primary.c (gfc_match_varspec): Pass information about * codimension to gfc_match_array_ref also for BT_CLASS. * resolve.c (resolve_procedure): Correct check for C612. 2010-12-11 Tobias Burnus <burnus@net-b.de> PR fortran/46370 * gfortran.dg/coarray_14.f90: New. From-SVN: r167715
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 9d8ee23..ab49e93 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -5027,13 +5027,6 @@ resolve_procedure:
{
gfc_ref *ref, *ref2 = NULL;
- if (e->ts.type == BT_CLASS)
- {
- gfc_error ("Polymorphic subobject of coindexed object at %L",
- &e->where);
- t = FAILURE;
- }
-
for (ref = e->ref; ref; ref = ref->next)
{
if (ref->type == REF_COMPONENT)
@@ -5046,6 +5039,14 @@ resolve_procedure:
if (ref->type == REF_COMPONENT)
break;
+ /* Expression itself is not coindexed object. */
+ if (ref && e->ts.type == BT_CLASS)
+ {
+ gfc_error ("Polymorphic subobject of coindexed object at %L",
+ &e->where);
+ t = FAILURE;
+ }
+
/* Expression itself is coindexed object. */
if (ref == NULL)
{