This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/42335] [OOP] ICE on CLASS IS (bad_identifier)



------- Comment #3 from janus at gcc dot gnu dot org  2009-12-09 18:17 -------
Mine.

I think this one-liner is all that's needed:

Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c        (revision 155023)
+++ gcc/fortran/symbol.c        (working copy)
@@ -2476,7 +2476,7 @@ select_type_insert_tmp (gfc_symtree **st)
 {
   gfc_select_type_stack *stack = select_type_stack;
   for (; stack; stack = stack->prev)
-    if ((*st)->n.sym == stack->selector)
+    if ((*st)->n.sym == stack->selector && stack->tmp)
       *st = stack->tmp;
 }


With this, the test case gives:

c0.f90:16.20:

    class is (bad_id)              ! ICE
                    1
Error: 'bad_id' at (1) is not an accessible derived type
c0.f90:17.36:

       this%elements(:) = v%elements(:)
                                    1
Error: 'elements' at (1) is not a member of the 'vector_class' structure


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-12-09 18:03:21         |2009-12-09 18:17:30
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]