aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-12-19 09:15:47 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2011-12-19 09:15:47 +0100
commitfac665b24a55893660c3c7e60fb92037181e8f0c (patch)
tree88e897b8431b8cdd2e0e6cf3dc40728adef39e0a /gcc/fortran/check.c
parent37ef545a763f325576a837b39d5a908c5e5ca1d9 (diff)
downloadgcc-fac665b24a55893660c3c7e60fb92037181e8f0c.zip
gcc-fac665b24a55893660c3c7e60fb92037181e8f0c.tar.gz
gcc-fac665b24a55893660c3c7e60fb92037181e8f0c.tar.bz2
check.c (coarray_check): Add class ref if needed.
2011-12-19 Tobias Burnus <burnus@net-b.de> * check.c (coarray_check): Add class ref if needed. * resolve.c (resolve_fl_var_and_proc, resolve_fl_derived0, resolve_symbol): Fix checking for BT_CLASS. 2011-12-19 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_poly_3.f90: New. * coarray/poly_run_1.f90: Enable some previously commented code. From-SVN: r182471
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index dca97cb..cb6b94f 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -206,6 +206,14 @@ double_check (gfc_expr *d, int n)
static gfc_try
coarray_check (gfc_expr *e, int n)
{
+ if (e->ts.type == BT_CLASS && gfc_expr_attr (e).class_ok
+ && CLASS_DATA (e)->attr.codimension
+ && CLASS_DATA (e)->as->corank)
+ {
+ gfc_add_class_array_ref (e);
+ return SUCCESS;
+ }
+
if (!gfc_is_coarray (e))
{
gfc_error ("Expected coarray variable as '%s' argument to the %s "
@@ -240,7 +248,7 @@ logical_array_check (gfc_expr *array, int n)
static gfc_try
array_check (gfc_expr *e, int n)
{
- if (e->ts.type == BT_CLASS
+ if (e->ts.type == BT_CLASS && gfc_expr_attr (e).class_ok
&& CLASS_DATA (e)->attr.dimension
&& CLASS_DATA (e)->as->rank)
{