re PR fortran/60952 ([F03] Problem using "end" as a type-bound procedure and containe...
authorJanus Weil <janus@gcc.gnu.org>
Sun, 13 Nov 2016 11:12:05 +0000 (12:12 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Sun, 13 Nov 2016 11:12:05 +0000 (12:12 +0100)
2016-11-13  Janus Weil  <janus@gcc.gnu.org>

PR fortran/60952
* decl.c (match_procedure_in_type): Apply the FL_PROCEDURE attribute
to the target procedure.

2016-11-13  Janus Weil  <janus@gcc.gnu.org>

PR fortran/60952
* gfortran.dg/typebound_proc_34.f90: New test.

From-SVN: r242352

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

index a9db062b4abc91c6b7d21bae244d30db7d03456b..b5324f255fab5cf935d5a825b79460336e2c84fb 100644 (file)
@@ -1,3 +1,9 @@
+2016-11-13  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/60952
+       * decl.c (match_procedure_in_type): Apply the FL_PROCEDURE attribute
+       to the target procedure.
+
 2016-11-13  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/66366
index 4f5c0cfa4ac4c1cbb36b956a6d55fbd79159c116..21eaafe488f0dbf0dd4e5388cd5d80b033c1ecb2 100644 (file)
@@ -9624,6 +9624,8 @@ match_procedure_in_type (void)
                            false))
        return MATCH_ERROR;
       gfc_set_sym_referenced (stree->n.tb->u.specific->n.sym);
+      gfc_add_flavor(&stree->n.tb->u.specific->n.sym->attr, FL_PROCEDURE,
+                    target, &stree->n.tb->u.specific->n.sym->declared_at);
 
       if (gfc_match_eos () == MATCH_YES)
        return MATCH_YES;
index 65fbaad34f9d8e1ce197497c3cf9f67125f22114..99bb0d4baea17f35bdffeac4c4d2ae4f9d211241 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-13  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/60952
+       * gfortran.dg/typebound_proc_34.f90: New test.
+
 2016-11-13  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/66366
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_34.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_34.f90
new file mode 100644 (file)
index 0000000..bf2b882
--- /dev/null
@@ -0,0 +1,26 @@
+! { dg-do compile }
+!
+! PR 60952: [F03] Problem using "end" as a type bound procedure and contained procedures
+!
+! Contributed by tlcclt <Thomas.L.Clune@nasa.gov>
+
+module A_mod
+  implicit none
+
+  type A
+  contains
+    procedure, nopass :: end
+  end type
+
+contains
+
+  subroutine swap
+  contains
+    subroutine subSwap
+    end subroutine
+  end subroutine
+
+  integer function end()
+  end function
+
+end module