diff options
| author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-23 08:00:01 +0000 |
|---|---|---|
| committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-23 08:00:01 +0000 |
| commit | eee5eae77b8b74a366fc8644ece56d2d04dec018 (patch) | |
| tree | 78248e90f68238801800ee76e96c0694d054231e /gcc/fortran/expr.c | |
| parent | bc45c9ffdd1813a3cecb164e96148634c5142a52 (diff) | |
| download | ppe42-gcc-eee5eae77b8b74a366fc8644ece56d2d04dec018.tar.gz ppe42-gcc-eee5eae77b8b74a366fc8644ece56d2d04dec018.zip | |
2008-09-22 Tobias Burnus <burnus@net-b.de>
PR fortran/37580
* expr.c (gfc_check_pointer_assign): Add checks for pointer
remapping.
2008-09-22 Tobias Burnus <burnus@net-b.de>
PR fortran/37580
* gfortran.dg/pointer_assign_5.f90: New test.
* gfortran.dg/pointer_assign_6.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140580 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/expr.c')
| -rw-r--r-- | gcc/fortran/expr.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index ba4be56c9c3..e15412adfbe 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2955,6 +2955,32 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) if (ref->type == REF_COMPONENT && ref->u.c.component->attr.pointer) pointer = 1; + + if (ref->type == REF_ARRAY && ref->next == NULL) + { + if (ref->u.ar.type == AR_FULL) + break; + + if (ref->u.ar.type != AR_SECTION) + { + gfc_error ("Expected bounds specification for '%s' at %L", + lvalue->symtree->n.sym->name, &lvalue->where); + return FAILURE; + } + + if (gfc_notify_std (GFC_STD_F2003,"Fortran 2003: Bounds " + "specification for '%s' in pointer assignment " + "at %L", lvalue->symtree->n.sym->name, + &lvalue->where) == FAILURE) + return FAILURE; + + gfc_error ("Pointer bounds remapping at %L is not yet implemented " + "in gfortran", &lvalue->where); + /* TODO: See PR 29785. Add checks that all lbounds are specified and + either never or always the upper-bound; strides shall not be + present. */ + return FAILURE; + } } if (check_intent_in && lvalue->symtree->n.sym->attr.intent == INTENT_IN) |

