OSDN Git Service

2010-08-03 Janus Weil <janus@gcc.gnu.org>
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Aug 2010 11:08:50 +0000 (11:08 +0000)
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Aug 2010 11:08:50 +0000 (11:08 +0000)
PR fortran/44584
PR fortran/45161
* class.c (add_procs_to_declared_vtab1): Don't add erroneous procedures.
* resolve.c (resolve_tb_generic_targets): Check for errors.

2010-08-03  Janus Weil  <janus@gcc.gnu.org>

PR fortran/44584
PR fortran/45161
* gfortran.dg/typebound_call_9.f03: Modified.
* gfortran.dg/typebound_generic_1.f03: Modified.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162840 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/class.c
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/typebound_call_9.f03
gcc/testsuite/gfortran.dg/typebound_generic_1.f03

index 3b5a435..23c0a1e 100644 (file)
@@ -1,3 +1,10 @@
+2010-08-03  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/44584
+       PR fortran/45161
+       * class.c (add_procs_to_declared_vtab1): Don't add erroneous procedures.
+       * resolve.c (resolve_tb_generic_targets): Check for errors.
+
 2010-08-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/45159
index 9393b56..558fda2 100644 (file)
@@ -257,10 +257,8 @@ add_procs_to_declared_vtab1 (gfc_symtree *st, gfc_symbol *vtype)
   if (st->right)
     add_procs_to_declared_vtab1 (st->right, vtype);
 
-  if (!st->n.tb)
-    return;
-
-  if (!st->n.tb->is_generic && st->n.tb->u.specific)
+  if (st->n.tb && !st->n.tb->error 
+      && !st->n.tb->is_generic && st->n.tb->u.specific)
     add_proc_comp (vtype, st->name, st->n.tb);
 }
 
index 6ccc565..90d193c 100644 (file)
@@ -10261,7 +10261,7 @@ resolve_tb_generic_targets (gfc_symbol* super_type,
        target_name = target->specific_st->name;
 
        /* Defined for this type directly.  */
-       if (target->specific_st->n.tb)
+       if (target->specific_st->n.tb && !target->specific_st->n.tb->error)
          {
            target->specific = target->specific_st->n.tb;
            goto specific_found;
index a869861..ffb6474 100644 (file)
@@ -1,3 +1,10 @@
+2010-08-03  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/44584
+       PR fortran/45161
+       * gfortran.dg/typebound_call_9.f03: Modified.
+       * gfortran.dg/typebound_generic_1.f03: Modified.
+
 2010-08-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/45159
index 6bb2ca8..4863f07 100644 (file)
@@ -17,7 +17,7 @@ module foo_mod
   contains
 
     procedure, pass(a) :: makenull ! { dg-error "has no argument 'a'" }
-    generic :: null2 => makenull
+    generic :: null2 => makenull   ! { dg-error "Undefined specific binding" }
 
   end type base_foo_type
 
@@ -50,7 +50,7 @@ contains
     endif
 
     call a%makenull()
-    call a%null2 () ! { dg-error "no matching specific binding" }
+    call a%null2 () ! { dg-error "should be a SUBROUTINE" }
 
     Return
   End Subroutine foo_free
index 1ae08fc..fb1dfae 100644 (file)
@@ -18,7 +18,7 @@ MODULE m
     GENERIC :: gen1 => p1a ! { dg-error "are ambiguous" }
 
     GENERIC, PUBLIC :: gen1 => p1, p2
-    GENERIC :: gen1 => p3 ! Implicitelly PUBLIC.
+    GENERIC :: gen1 => p3 ! Implicitly PUBLIC.
     GENERIC, PRIVATE :: gen2 => p1
 
     GENERIC :: gen2 => p2 ! { dg-error "same access" }
@@ -29,7 +29,8 @@ MODULE m
     GENERIC :: gen3 => ! { dg-error "specific binding" }
     GENERIC :: gen4 => p1 x ! { dg-error "Junk after" }
     GENERIC :: gen5 => p_notthere ! { dg-error "Undefined specific binding" }
-    GENERIC :: gen6 => gen1 ! { dg-error "must target a specific binding" }
+    GENERIC :: gen6 => p1
+    GENERIC :: gen7 => gen6 ! { dg-error "must target a specific binding" }
 
     GENERIC :: gensubr => p2 ! { dg-error "mixed FUNCTION/SUBROUTINE" }
     GENERIC :: gensubr => subr