From 1f302f2ea08687d04233ecf013c42bba87e03f7f Mon Sep 17 00:00:00 2001 From: janus Date: Sun, 13 Nov 2016 11:12:05 +0000 Subject: [PATCH] 2016-11-13 Janus Weil PR fortran/60952 * decl.c (match_procedure_in_type): Apply the FL_PROCEDURE attribute to the target procedure. 2016-11-13 Janus Weil PR fortran/60952 * gfortran.dg/typebound_proc_34.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242352 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/decl.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/typebound_proc_34.f90 | 26 +++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/typebound_proc_34.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a9db062b4ab..b5324f255fa 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2016-11-13 Janus Weil + PR fortran/60952 + * decl.c (match_procedure_in_type): Apply the FL_PROCEDURE attribute + to the target procedure. + +2016-11-13 Janus Weil + PR fortran/66366 * resolve.c (resolve_component): Move check for C437 to ... diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 4f5c0cfa4ac..21eaafe488f 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 65fbaad34f9..99bb0d4baea 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2016-11-13 Janus Weil + PR fortran/60952 + * gfortran.dg/typebound_proc_34.f90: New test. + +2016-11-13 Janus Weil + PR fortran/66366 * gfortran.dg/class_57.f90: Changed error message. * gfortran.dg/class_60.f90: New test. diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_34.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_34.f90 new file mode 100644 index 00000000000..bf2b882bb7a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_34.f90 @@ -0,0 +1,26 @@ +! { dg-do compile } +! +! PR 60952: [F03] Problem using "end" as a type bound procedure and contained procedures +! +! Contributed by tlcclt + +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 -- 2.11.4.GIT