]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/45439 ([OOP] SELECT TYPE bogus complaint about INTENT)
authorJanus Weil <janus@gcc.gnu.org>
Sun, 29 Aug 2010 09:56:45 +0000 (11:56 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Sun, 29 Aug 2010 09:56:45 +0000 (11:56 +0200)
2010-08-29  Janus Weil  <janus@gcc.gnu.org>

PR fortran/45439
* match.c (gfc_match_select_type): Give the associate-name the
FL_VARIABLE attribute.

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

PR fortran/45439
* gfortran.dg/select_type_16.f03: New.

From-SVN: r163626

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

index 669d9b4dc45a33f08e565b99e3e1f64c250fc709..9dab6972e306f9f4afd9e4f339af3ea1b4685f7d 100644 (file)
@@ -1,4 +1,10 @@
-2010-07-21  Steven G. Kargl  <kargl@gcc.gnu.org>
+2010-08-29  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/45439
+       * match.c (gfc_match_select_type): Give the associate-name the
+       FL_VARIABLE attribute.
+
+2010-07-28  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        * simplify.c (gfc_simplify_bessel_n2): Fix indention
        and argument type.
index 47cd8d6be936401c7dc40d64b96a0e28a60580fe..14f2417e292fc35c2f1f5b4d763876c6852a2fa3 100644 (file)
@@ -4532,6 +4532,7 @@ gfc_match_select_type (void)
        expr1->symtree->n.sym->attr.untyped = 1;
       else
        expr1->symtree->n.sym->ts = expr2->ts;
+      expr1->symtree->n.sym->attr.flavor = FL_VARIABLE;
       expr1->symtree->n.sym->attr.referenced = 1;
       expr1->symtree->n.sym->attr.class_ok = 1;
     }
index 931dfb7f6d2f143f7fd36e12420a9b33ce839691..5a9f38a05507340b59793e2cf69d4866c08d5bc4 100644 (file)
@@ -1,4 +1,9 @@
-2010-07-21  Steven G. Kargl  <kargl@gcc.gnu.org>
+2010-08-29  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/45439
+       * gfortran.dg/select_type_16.f03: New.
+
+2010-07-28  Steven G. Kargl  <kargl@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>
 
        * gfortran.dg/bessel_7.f90: Decrease required precision.
diff --git a/gcc/testsuite/gfortran.dg/select_type_16.f03 b/gcc/testsuite/gfortran.dg/select_type_16.f03
new file mode 100644 (file)
index 0000000..29d1930
--- /dev/null
@@ -0,0 +1,41 @@
+! { dg-do compile }
+!
+! PR 45439: [OOP] SELECT TYPE bogus complaint about INTENT
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+
+module d_base_mat_mod
+
+  implicit none
+
+  type :: d_base_sparse_mat
+  contains
+    procedure, pass(a) :: mv_to_coo   => d_base_mv_to_coo   
+  end type d_base_sparse_mat
+
+  interface 
+    subroutine d_base_mv_to_coo(a)
+      import d_base_sparse_mat
+      class(d_base_sparse_mat), intent(inout) :: a
+    end subroutine d_base_mv_to_coo
+  end interface
+
+  type :: d_sparse_mat
+    class(d_base_sparse_mat), allocatable  :: a 
+  end type d_sparse_mat
+
+contains
+
+  subroutine bug21(ax)
+    type(d_sparse_mat), intent(inout) :: ax
+    select type(aa=> ax%a)
+    class default
+      call aa%mv_to_coo() 
+    end select
+  end subroutine bug21
+
+end module d_base_mat_mod
+
+
+! { dg-final { cleanup-modules "d_base_mat_mod" } }