From f08f8b6a53374bede927c5839e6e8dc6353ef343 Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Sun, 29 Aug 2010 11:56:45 +0200 Subject: [PATCH] re PR fortran/45439 ([OOP] SELECT TYPE bogus complaint about INTENT) 2010-08-29 Janus Weil PR fortran/45439 * match.c (gfc_match_select_type): Give the associate-name the FL_VARIABLE attribute. 2010-08-29 Janus Weil PR fortran/45439 * gfortran.dg/select_type_16.f03: New. From-SVN: r163626 --- gcc/fortran/ChangeLog | 8 +++- gcc/fortran/match.c | 1 + gcc/testsuite/ChangeLog | 7 +++- gcc/testsuite/gfortran.dg/select_type_16.f03 | 41 ++++++++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/select_type_16.f03 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 669d9b4dc45..9dab6972e30 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,10 @@ -2010-07-21 Steven G. Kargl +2010-08-29 Janus Weil + + PR fortran/45439 + * match.c (gfc_match_select_type): Give the associate-name the + FL_VARIABLE attribute. + +2010-07-28 Steven G. Kargl * simplify.c (gfc_simplify_bessel_n2): Fix indention and argument type. diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 47cd8d6be93..14f2417e292 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 931dfb7f6d2..5a9f38a0550 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2010-07-21 Steven G. Kargl +2010-08-29 Janus Weil + + PR fortran/45439 + * gfortran.dg/select_type_16.f03: New. + +2010-07-28 Steven G. Kargl Tobias Burnus * 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 index 00000000000..29d19300a1b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_type_16.f03 @@ -0,0 +1,41 @@ +! { dg-do compile } +! +! PR 45439: [OOP] SELECT TYPE bogus complaint about INTENT +! +! Contributed by Salvatore Filippone + + +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" } }