public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/60232] [OOP] The rank of the element in the structure constructor does not match that of the component
       [not found] <bug-60232-4@http.gcc.gnu.org/bugzilla/>
@ 2014-02-17  9:48 ` janus at gcc dot gnu.org
  2014-02-18 21:21 ` janus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu.org @ 2014-02-17  9:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60232

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-17
                 CC|                            |janus at gcc dot gnu.org
            Summary|OOP False Error: The rank   |[OOP] The rank of the
                   |of the element in the       |element in the structure
                   |structure constructor       |constructor does not match
                   |                            |that of the component
     Ever confirmed|0                           |1

--- Comment #1 from janus at gcc dot gnu.org ---
Reduced test case:


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


Same error with 4.7, 4.8 and trunk. (In 4.6 and earlier, polymorphic arrays are
not supported yet.)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/60232] [OOP] The rank of the element in the structure constructor does not match that of the component
       [not found] <bug-60232-4@http.gcc.gnu.org/bugzilla/>
  2014-02-17  9:48 ` [Bug fortran/60232] [OOP] The rank of the element in the structure constructor does not match that of the component janus at gcc dot gnu.org
@ 2014-02-18 21:21 ` janus at gcc dot gnu.org
  2014-02-18 22:13 ` janus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu.org @ 2014-02-18 21:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60232

--- Comment #3 from janus at gcc dot gnu.org ---
I think this patch is even better:

Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c    (revision 207846)
+++ gcc/fortran/expr.c    (working copy)
@@ -3962,9 +3962,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;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/60232] [OOP] The rank of the element in the structure constructor does not match that of the component
       [not found] <bug-60232-4@http.gcc.gnu.org/bugzilla/>
  2014-02-17  9:48 ` [Bug fortran/60232] [OOP] The rank of the element in the structure constructor does not match that of the component janus at gcc dot gnu.org
  2014-02-18 21:21 ` janus at gcc dot gnu.org
@ 2014-02-18 22:13 ` janus at gcc dot gnu.org
  2014-02-19 11:53 ` janus at gcc dot gnu.org
  2014-02-19 11:55 ` janus at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu.org @ 2014-02-18 22:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60232

--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to janus from comment #3)
> I think this patch is even better:

... and regtests cleanly.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/60232] [OOP] The rank of the element in the structure constructor does not match that of the component
       [not found] <bug-60232-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-02-18 22:13 ` janus at gcc dot gnu.org
@ 2014-02-19 11:53 ` janus at gcc dot gnu.org
  2014-02-19 11:55 ` janus at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu.org @ 2014-02-19 11:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60232

--- Comment #5 from janus at gcc dot gnu.org ---
Author: janus
Date: Wed Feb 19 11:52:39 2014
New Revision: 207896

URL: http://gcc.gnu.org/viewcvs?rev=207896&root=gcc&view=rev
Log:
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.

Added:
    trunk/gcc/testsuite/gfortran.dg/typebound_proc_33.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/60232] [OOP] The rank of the element in the structure constructor does not match that of the component
       [not found] <bug-60232-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-02-19 11:53 ` janus at gcc dot gnu.org
@ 2014-02-19 11:55 ` janus at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu.org @ 2014-02-19 11:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60232

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from janus at gcc dot gnu.org ---
Fixed on trunk with r207896. Closing.

Thanks for the report!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-19 11:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-60232-4@http.gcc.gnu.org/bugzilla/>
2014-02-17  9:48 ` [Bug fortran/60232] [OOP] The rank of the element in the structure constructor does not match that of the component janus at gcc dot gnu.org
2014-02-18 21:21 ` janus at gcc dot gnu.org
2014-02-18 22:13 ` janus at gcc dot gnu.org
2014-02-19 11:53 ` janus at gcc dot gnu.org
2014-02-19 11:55 ` janus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).