diff options
author | Janus Weil <janus@gcc.gnu.org> | 2014-02-19 12:52:39 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2014-02-19 12:52:39 +0100 |
commit | 1251a8be603722c2bf1c894c987cfe2f724d1568 (patch) | |
tree | e5c4bbf0826117aa74b28f32f66bd01e9eecd6c6 | |
parent | 476b301a0c62213400f5208c55a2a0f1120790ce (diff) | |
download | gcc-1251a8be603722c2bf1c894c987cfe2f724d1568.zip gcc-1251a8be603722c2bf1c894c987cfe2f724d1568.tar.gz gcc-1251a8be603722c2bf1c894c987cfe2f724d1568.tar.bz2 |
re PR fortran/60232 ([OOP] The rank of the element in the structure constructor does not match that of the component)
2014-02-19 Janus Weil <janus@gcc.gnu.org>
PR fortran/60232
* expr.c (gfc_get_variable_expr): Don't add REF_ARRAY for dimensionful
functions, which are used as procedure pointer target.
2014-02-19 Janus Weil <janus@gcc.gnu.org>
PR fortran/60232
* gfortran.dg/typebound_proc_33.f90: New.
From-SVN: r207896
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/expr.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/typebound_proc_33.f90 | 39 |
4 files changed, 54 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c1bca00..b0c0c57 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2014-02-19 Janus Weil <janus@gcc.gnu.org> + + PR fortran/60232 + * expr.c (gfc_get_variable_expr): Don't add REF_ARRAY for dimensionful + functions, which are used as procedure pointer target. + 2014-02-18 Tobias Burnus <burnus@net-b.de> PR fortran/49397 diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index fe6eab5..fe92c53a 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3972,9 +3972,10 @@ gfc_get_variable_expr (gfc_symtree *var) e->symtree = var; e->ts = var->n.sym->ts; - if ((var->n.sym->as != NULL && var->n.sym->ts.type != BT_CLASS) - || (var->n.sym->ts.type == BT_CLASS && CLASS_DATA (var->n.sym) - && CLASS_DATA (var->n.sym)->as)) + if (var->n.sym->attr.flavor != FL_PROCEDURE + && ((var->n.sym->as != NULL && var->n.sym->ts.type != BT_CLASS) + || (var->n.sym->ts.type == BT_CLASS && CLASS_DATA (var->n.sym) + && CLASS_DATA (var->n.sym)->as))) { e->rank = var->n.sym->ts.type == BT_CLASS ? CLASS_DATA (var->n.sym)->as->rank : var->n.sym->as->rank; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e246657..da20072 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-02-19 Janus Weil <janus@gcc.gnu.org> + + PR fortran/60232 + * gfortran.dg/typebound_proc_33.f90: New. + 2014-02-19 Marek Polacek <polacek@redhat.com> PR c/60195 diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_33.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_33.f90 new file mode 100644 index 0000000..68ea53f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_33.f90 @@ -0,0 +1,39 @@ +! { dg-do compile } +! +! PR 60232: [OOP] The rank of the element in the structure constructor does not match that of the component +! +! Contributed by Antony Lewis <antony@cosmologist.info> + +module ObjectLists + implicit none + + Type TObjectList + contains + procedure :: ArrayItem + end Type + +contains + + function ArrayItem(L) result(P) + Class(TObjectList) :: L + Class(TObjectList), pointer :: P(:) + end function + +end module + + + use ObjectLists + implicit none + + Type, extends(TObjectList):: TSampleList + end Type + +contains + + subroutine TSampleList_ConfidVal(L) + Class(TSampleList) :: L + end subroutine + +end + +! { dg-final { cleanup-modules "ObjectLists" } } |