aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
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)
{