User account creation filtered due to spam.

Bug 35031 - ELEMENTAL procedure with BIND(C)
Summary: ELEMENTAL procedure with BIND(C)
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: accepts-invalid
Depends on:
Blocks: 32630
  Show dependency treegraph
Reported: 2008-01-30 16:12 UTC by Tobias Burnus
Modified: 2015-11-04 10:46 UTC (History)
4 users (show)

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


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:


 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.


 Replace C1242 in subclause with
 "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:
(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:
> (Not yet sent to ISO and thus also not ISO approved.)

Comment 3 Francois-Xavier Coudert 2014-07-09 22:38:52 UTC
That code is now rejected (for a wrong reason), due to PR61765.
Comment 4 Dominique d'Humieres 2015-11-04 10:46:24 UTC
This is

C1252 An elemental procedure shall not have the BIND attribute.

in subclause of my Fortran 2015 draft.