This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/30034] New: pure subroutine requires intent for procedure argument


The following declaration

 pure subroutine s_one ( anum, afun )
    integer, intent(in) :: anum
    interface
      pure function afun (k) result (l)
        implicit none
        integer, intent(in) :: k
        integer :: l
      end function afun
    end interface

results in the error (using lates build of gfortran-4.3):

Error: Argument 'afun' of pure subroutine 's_one' at (1) must have its INTENT
specified

The section 12.6 of ISO/IEC 1539-1 says:

Constraint: The specification-part of a pure function subprogram shall specify
that all dummy arguments have INTENT (IN) except procedure arguments and
arguments with the POINTER attribute.

which as far I understand means theat the code above is corrent (without intent
statement for 'afun'.

Cheers, T.


-- 
           Summary: pure subroutine requires intent for procedure argument
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: trumsko at yahoo dot com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]