[Bug fortran/36325] specific or generic INTERFACE implies the EXTERNAL attribute
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon May 26 20:34:00 GMT 2008
------- Comment #11 from burnus at gcc dot gnu dot org 2008-05-26 20:34 -------
> Moreover it includes another related bugfix (see PR35830 comment #2).
Nice. If everything works, one should submit it, including new test cases.
> Regarding Tobi's comment #7:
>
> interface
> real function bar()
> end function bar
> end interface
> dimension :: bar(4)
>
> Why would I need to reject this? At least it's compatible with
>
> conflict(external with implicit interface, dimension)
>
> because it has an explicit interface.
> I think the problem is rather that the dimension statement contradicts
> the interface statement, which says that 'bar'
> returns a scalar real number (and not an array).
I agree. Fortran 2003 states:
"An interface body specifies all of the characteristics of the explicit
specific interface or abstract interface."
> g95's error message is:
> Error: Attribute declaration of 'bar' at (1) is outside of the INTERFACE body
Same with NAG f95:
Error: Dimensions specified for BAR outside its INTERFACE body
ifort has:
"Error: This name has already been used as an external procedure name. [BAR]"
> So I guess it is indeed invalid (and accepted by gfortran), but this seems to
> be unrelated to this PR (probably it deserves a separate PR).
I agree that it can be an extra PR. Analogous problem for ALLOCATABLE.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36325
More information about the Gcc-bugs
mailing list