aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorErik Edelmann <eedelman@gcc.gnu.org>2006-11-19 21:27:16 +0000
committerErik Edelmann <eedelman@gcc.gnu.org>2006-11-19 21:27:16 +0000
commit51f824b647754fb8fd2df8198a66efd57a4e3751 (patch)
treeaf12fdcf3beba892bb802c4d80e240632d1ab3ab /gcc/fortran
parent39f87c0333117fa64894cb1f7dd0e69307a9cf0d (diff)
downloadgcc-51f824b647754fb8fd2df8198a66efd57a4e3751.zip
gcc-51f824b647754fb8fd2df8198a66efd57a4e3751.tar.gz
gcc-51f824b647754fb8fd2df8198a66efd57a4e3751.tar.bz2
resolve.c (resolve_ref): Check for ALLOCATABLEs to the right of nonzero rank part references too.
fortran/ 2006-11-19 Erik Edelmann <eedelman@gcc.gnu.org> * resolve.c (resolve_ref): Check for ALLOCATABLEs to the right of nonzero rank part references too. testsuite/ 2006-11-19 Erik Edelmann <eedelman@gcc.gnu.org> * gfortran.dg/alloc_comp_constraint_5.f90: New. * gfortran.dg/alloc_comp_assign_2.f90: Removed invalid code. From-SVN: r118999
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/resolve.c24
2 files changed, 22 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 70ca870..6efdfac 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-19 Erik Edelmann <eedelman@gcc.gnu.org>
+
+ * resolve.c (resolve_ref): Check for ALLOCATABLEs to the right of
+ nonzero rank part references too.
+
2006-11-19 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* module.c (gfc_use_module): Uncomment the ISO_FORTRAN_ENV code.
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 31e1d7c..3d567cb 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -2797,14 +2797,24 @@ resolve_ref (gfc_expr * expr)
break;
case REF_COMPONENT:
- if ((current_part_dimension || seen_part_dimension)
- && ref->u.c.component->pointer)
+ if (current_part_dimension || seen_part_dimension)
{
- gfc_error
- ("Component to the right of a part reference with nonzero "
- "rank must not have the POINTER attribute at %L",
- &expr->where);
- return FAILURE;
+ if (ref->u.c.component->pointer)
+ {
+ gfc_error
+ ("Component to the right of a part reference with nonzero "
+ "rank must not have the POINTER attribute at %L",
+ &expr->where);
+ return FAILURE;
+ }
+ else if (ref->u.c.component->allocatable)
+ {
+ gfc_error
+ ("Component to the right of a part reference with nonzero "
+ "rank must not have the ALLOCATABLE attribute at %L",
+ &expr->where);
+ return FAILURE;
+ }
}
n_components++;