OSDN Git Service

2010-06-24 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jun 2010 07:51:22 +0000 (07:51 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jun 2010 07:51:22 +0000 (07:51 +0000)
        PR fortran/44614
        * decl.c (variable_decl): Fix IMPORT diagnostic for CLASS.

2010-06-24  Tobias Burnus  <burnus@net-b.de>

        PR fortran/44614
        * gfortran.dg/import8.f90: New.

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

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/import8.f90 [new file with mode: 0644]

index 07a5825..e887e6f 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-24  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/44614
+       * decl.c (variable_decl): Fix IMPORT diagnostic for CLASS.
+
 2010-06-22  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/44616
index f7f4800..aa7a266 100644 (file)
@@ -1764,7 +1764,7 @@ variable_decl (int elem)
      specified in the procedure definition, except that the interface
      may specify a procedure that is not pure if the procedure is
      defined to be pure(12.3.2).  */
-  if (current_ts.type == BT_DERIVED
+  if ((current_ts.type == BT_DERIVED || current_ts.type == BT_CLASS)
       && gfc_current_ns->proc_name
       && gfc_current_ns->proc_name->attr.if_source == IFSRC_IFBODY
       && current_ts.u.derived->ns != gfc_current_ns)
index ffc1ce9..2dbff36 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-24  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/44614
+       * gfortran.dg/import8.f90: New.
+
 2010-06-23  Arnaud Charlet  <charlet@adacore.com>
 
        * gnat.dg/not_null.adb: Update test case.
diff --git a/gcc/testsuite/gfortran.dg/import8.f90 b/gcc/testsuite/gfortran.dg/import8.f90
new file mode 100644 (file)
index 0000000..0d88e62
--- /dev/null
@@ -0,0 +1,18 @@
+! { dg-do compile }
+!
+! PR fortran/44614
+!
+!
+
+implicit none
+
+type, abstract :: Connection
+end type Connection
+
+abstract interface
+    subroutine generic_desc(self)
+        ! <<< missing IMPORT 
+        class(Connection) :: self ! { dg-error "has not been declared within the interface" }
+    end subroutine generic_desc
+end interface
+end