OSDN Git Service

2010-06-22 Janus Weil <janus@gcc.gnu.org>
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Jun 2010 17:07:06 +0000 (17:07 +0000)
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Jun 2010 17:07:06 +0000 (17:07 +0000)
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.

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

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

index 1385318..07a5825 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 20def44..96b3e8d 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 54d13fd..326f2bc 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" } }