------- Comment #8 from burnus at gcc dot gnu dot org  2010-04-01 12:28 -------
(In reply to comment #6)
> But that's not the problem:
>   type t
>      procedure(p1_type), nopass, pointer :: p1 => NULL()
>      procedure(p2_type), nopass, pointer :: p2 => NULL()

That's not valid either as you have not defined "p1_type" - replacing it by
INTEGER should work, though.  -- Well, it actually does not as specification
expressions need to be PURE.

 * * *

Daniel, Janus: What do you think about the following incomplete patch? It needs
some extra handling as, e.g., the PURE check fails for the procedure pointer
(it works for the type-bound procedure) and maybe one should insert an assert
that it is really a function and not a subroutine and things like that, but
otherwise it seems to work.

Test case:
!----------------------------
module m
  implicit none
  type t
     procedure(p1_type), nopass, pointer :: p1 => NULL()
  contains
     procedure, nopass :: tbp => p1_type
  end type t
contains
  subroutine proc (t1, t2)
    type(t), intent(in) :: t1, t2
    integer, dimension(t1%p1(), t2%tbp()) :: table
  end subroutine proc
  pure function p1_type()
   integer :: p1_type
   p1_type = 42
  end function p1_type
end module m
!----------------------------

Index: expr.c
===================================================================
--- expr.c      (revision 157899)
+++ expr.c      (working copy)
@@ -3559,6 +3559,8 @@ gfc_traverse_expr (gfc_expr *expr, gfc_s

   switch (expr->expr_type)
     {
+    case EXPR_PPC:
+    case EXPR_COMPCALL:
     case EXPR_FUNCTION:
       for (args = expr->value.function.actual; args; args = args->next)
        {


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |domob at gcc dot gnu dot org
  GCC build triplet|x86_64-unknown-linux-gnu    |
   GCC host triplet|x86_64-unknown-linux-gnu    |
 GCC target triplet|x86_64-unknown-linux-gnu    |
   Last reconfirmed|2010-03-30 17:58:35         |2010-04-01 12:28:49
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43591

Reply via email to