ELEMENTAL conflicts with BIND(C).

However, the following is not rejected (diagnosed) by gfortran:

   elemental subroutine sub(x)
     integer, intent(in) :: x
     entry sub_c(x) bind(c)
   end subroutine sub

Actually, this is a loop hole in the Fortran 2003 standard, which will be
presumably fixed by an erratum. (It passed the J3 ballot, WG3 and ISO approval
are still needed.) See F03/0086:

ANSWER:

 No, it is not allowed. Constraint C1242 was intended to disallow
 the combination of elemental and BIND(C), but it inadvertently
 failed to cover the case shown in the above example.

EDITS

 Replace C1242 in subclause 12.5.2.1 with
 [280:6-7]
 "C1242 An ELEMENTAL procedure shall not have the BIND attribute.".


-- 
           Summary: ELEMENTAL procedure with BIND(C)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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

Reply via email to