]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2010-05-22 Janus Weil <janus@gcc.gnu.org>
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 22 May 2010 10:21:32 +0000 (10:21 +0000)
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 22 May 2010 10:21:32 +0000 (10:21 +0000)
PR fortran/44213
* resolve.c (ensure_not_abstract): Allow abstract types with
non-abstract ancestors.

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

PR fortran/44213
* gfortran.dg/abstract_type_7.f03: New.

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

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

index fc996199e5c99e31cdcf59630f0940c004b782b3..9e4702e40a4b3081855c78b6cfeeabb28ca2f345 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-22  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/44213
+       * resolve.c (ensure_not_abstract): Allow abstract types with
+       non-abstract ancestors.
+
 2010-05-21  Steven Bosscher  <steven@gcc.gnu.org>
 
        * trans-const.c: Include realmpfr.h.
index e5a46fac6155fd04e78b16789703851dc5cfc8bc..f08e1988816cc8a4b17ca2e48163415b4fcc6099 100644 (file)
@@ -10541,7 +10541,10 @@ ensure_not_abstract (gfc_symbol* sub, gfc_symbol* ancestor)
      This is not the most efficient way to do this, but it should be ok and is
      clearer than something sophisticated.  */
 
-  gcc_assert (ancestor && ancestor->attr.abstract && !sub->attr.abstract);
+  gcc_assert (ancestor && !sub->attr.abstract);
+  
+  if (!ancestor->attr.abstract)
+    return SUCCESS;
 
   /* Walk bindings of this ancestor.  */
   if (ancestor->f2k_derived)
index 227a77c73a8527cd34e2d2b9223a32e75eb39fd5..faea1c4fe93e76f00120e4e5cd08498c7eff0667 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-22  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/44213
+       * gfortran.dg/abstract_type_7.f03: New.
+
 2010-05-21  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/eh/spec11.C: Test cleanup optimization.
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_7.f03 b/gcc/testsuite/gfortran.dg/abstract_type_7.f03
new file mode 100644 (file)
index 0000000..3ea0fdc
--- /dev/null
@@ -0,0 +1,18 @@
+! { dg-do compile }
+!
+! PR 44213: ICE when extending abstract type
+!
+! Contributed by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de>
+
+module ice_module
+  type :: a_type
+  end type a_type
+
+  type,extends(a_type),abstract :: b_type
+  end type b_type
+
+  type,extends(b_type) :: c_type
+  end type c_type
+end module ice_module
+! { dg-final { cleanup-modules "ice_module" } }