re PR fortran/44616 ([OOP] ICE if CLASS(foo) is used before its definition)
authorJanus Weil <janus@gcc.gnu.org>
Tue, 22 Jun 2010 17:07:06 +0000 (19:07 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Tue, 22 Jun 2010 17:07:06 +0000 (19:07 +0200)
2010-06-22  Janus Weil  <janus@gcc.gnu.org>

PR fortran/44616
* resolve.c (resolve_fl_derived): Avoid checking for abstract on class
containers.

2010-06-22  Janus Weil  <janus@gcc.gnu.org>

PR fortran/44616
* gfortran.dg/abstract_type_8.f03: New.

From-SVN: r161208

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/abstract_type_8.f03 [new file with mode: 0644]

index 1385318d55070e4ea585f2f4ff40697dd0bd4452..07a5825123b40092751d9ca06d31d17bb960b146 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-22  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/44616
+       * resolve.c (resolve_fl_derived): Avoid checking for abstract on class
+       containers.
+
 2010-06-21  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/40632
index 20def447767a29f73f7ff50fe04898430de8b0ae..96b3e8daab153266a6ffd4a24869e6ad71db871e 100644 (file)
@@ -11144,6 +11144,7 @@ resolve_fl_derived (gfc_symbol *sym)
   /* If this is a non-ABSTRACT type extending an ABSTRACT one, ensure that
      all DEFERRED bindings are overridden.  */
   if (super_type && super_type->attr.abstract && !sym->attr.abstract
+      && !sym->attr.is_class
       && ensure_not_abstract (sym, super_type) == FAILURE)
     return FAILURE;
 
index 54d13fd22c5845c1652d765366413ab58a9f9ce9..326f2bcc4ee54b29afb6cc05172632d8f8e020b3 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-22  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/44616
+       * gfortran.dg/abstract_type_8.f03: New.
+
 2010-06-21  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/cpp0x/noexcept08.C: New.
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_8.f03 b/gcc/testsuite/gfortran.dg/abstract_type_8.f03
new file mode 100644 (file)
index 0000000..c924aba
--- /dev/null
@@ -0,0 +1,29 @@
+! { dg-do compile }
+!
+! PR 44616: [OOP] ICE if CLASS(foo) is used before its definition
+!
+! Contributed by bd satish <bdsatish@gmail.com>
+
+module factory_pattern
+implicit none
+
+type First_Factory
+    character(len=20) :: factory_type
+    class(Connection), pointer :: connection_type
+    contains
+end type First_Factory
+
+type, abstract :: Connection
+    contains
+    procedure(generic_desc), deferred :: description
+end type Connection
+
+abstract interface
+    subroutine generic_desc(self)
+        import  ! Required, cf. PR 44614
+        class(Connection) :: self
+    end subroutine generic_desc
+end interface
+end module factory_pattern
+
+! { dg-final { cleanup-modules "factory_pattern" } }