Bug 35031 - ELEMENTAL procedure with BIND(C)
ELEMENTAL procedure with BIND(C)
Status: NEW
Product: gcc
Classification: Unclassified
Component: fortran
4.3.0
: P3 normal
: ---
Assigned To: Not yet assigned to anyone
: accepts-invalid
Depends on:
Blocks: 32630
  Show dependency treegraph
 
Reported: 2008-01-30 16:12 UTC by Tobias Burnus
Modified: 2010-05-09 13:34 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-02-04 17:34:53


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2008-01-30 16:12:13 UTC
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.".
Comment 1 Tobias Burnus 2008-06-02 16:06:40 UTC
Draft 2003 corrigendum 3: ftp://ftp.nag.co.uk/sc22wg5/N1701-N1750/N1727.pdf
(Not yet sent to ISO and thus also not ISO approved.)
Comment 2 Daniel Franke 2010-05-09 13:34:04 UTC
(In reply to comment #1)
> Draft 2003 corrigendum 3: ftp://ftp.nag.co.uk/sc22wg5/N1701-N1750/N1727.pdf
> (Not yet sent to ISO and thus also not ISO approved.)

See ftp://ftp.nag.co.uk/sc22wg5/N1701-N1750/N1731.pdf